From 994f67e1f78622feb06dcacc83862f92c76984e5 Mon Sep 17 00:00:00 2001 From: TitoChan <2289479734@qq.com> Date: Wed, 19 Jun 2024 12:07:04 +0800 Subject: [PATCH] gengxin --- iotDjangoBackend/db.sqlite3 | Bin 0 -> 131072 bytes iotDjangoBackend/iot/__init__.py | 0 .../iot/__pycache__/__init__.cpython-311.pyc | Bin 0 -> 165 bytes .../iot/__pycache__/admin.cpython-311.pyc | Bin 0 -> 670 bytes .../iot/__pycache__/apps.cpython-311.pyc | Bin 0 -> 530 bytes .../iot/__pycache__/consumers.cpython-311.pyc | Bin 0 -> 2147 bytes .../iot/__pycache__/models.cpython-311.pyc | Bin 0 -> 885 bytes .../iot/__pycache__/routing.cpython-311.pyc | Bin 0 -> 416 bytes iotDjangoBackend/iot/admin.py | 8 ++ iotDjangoBackend/iot/apps.py | 6 + iotDjangoBackend/iot/consumers.py | 30 ++++ .../iot/migrations/0001_initial.py | 24 ++++ iotDjangoBackend/iot/migrations/__init__.py | 0 .../__pycache__/0001_initial.cpython-311.pyc | Bin 0 -> 1021 bytes .../__pycache__/__init__.cpython-311.pyc | Bin 0 -> 176 bytes iotDjangoBackend/iot/models.py | 10 ++ iotDjangoBackend/iot/routing.py | 7 + iotDjangoBackend/iot/tests.py | 3 + iotDjangoBackend/iot/views.py | 8 ++ iotDjangoBackend/iotBackEnd/__init__.py | 0 .../__pycache__/__init__.cpython-310.pyc | Bin 0 -> 156 bytes .../__pycache__/__init__.cpython-311.pyc | Bin 0 -> 172 bytes .../__pycache__/asgi.cpython-310.pyc | Bin 0 -> 922 bytes .../__pycache__/asgi.cpython-311.pyc | Bin 0 -> 1284 bytes .../__pycache__/settings.cpython-311.pyc | Bin 0 -> 2799 bytes .../__pycache__/urls.cpython-311.pyc | Bin 0 -> 1058 bytes .../__pycache__/wsgi.cpython-311.pyc | Bin 0 -> 700 bytes iotDjangoBackend/iotBackEnd/asgi.py | 28 ++++ iotDjangoBackend/iotBackEnd/routings.py | 8 ++ iotDjangoBackend/iotBackEnd/settings.py | 133 ++++++++++++++++++ iotDjangoBackend/iotBackEnd/urls.py | 22 +++ iotDjangoBackend/iotBackEnd/wsgi.py | 16 +++ iotDjangoBackend/manage.py | 22 +++ 33 files changed, 325 insertions(+) create mode 100644 iotDjangoBackend/db.sqlite3 create mode 100644 iotDjangoBackend/iot/__init__.py create mode 100644 iotDjangoBackend/iot/__pycache__/__init__.cpython-311.pyc create mode 100644 iotDjangoBackend/iot/__pycache__/admin.cpython-311.pyc create mode 100644 iotDjangoBackend/iot/__pycache__/apps.cpython-311.pyc create mode 100644 iotDjangoBackend/iot/__pycache__/consumers.cpython-311.pyc create mode 100644 iotDjangoBackend/iot/__pycache__/models.cpython-311.pyc create mode 100644 iotDjangoBackend/iot/__pycache__/routing.cpython-311.pyc create mode 100644 iotDjangoBackend/iot/admin.py create mode 100644 iotDjangoBackend/iot/apps.py create mode 100644 iotDjangoBackend/iot/consumers.py create mode 100644 iotDjangoBackend/iot/migrations/0001_initial.py create mode 100644 iotDjangoBackend/iot/migrations/__init__.py create mode 100644 iotDjangoBackend/iot/migrations/__pycache__/0001_initial.cpython-311.pyc create mode 100644 iotDjangoBackend/iot/migrations/__pycache__/__init__.cpython-311.pyc create mode 100644 iotDjangoBackend/iot/models.py create mode 100644 iotDjangoBackend/iot/routing.py create mode 100644 iotDjangoBackend/iot/tests.py create mode 100644 iotDjangoBackend/iot/views.py create mode 100644 iotDjangoBackend/iotBackEnd/__init__.py create mode 100644 iotDjangoBackend/iotBackEnd/__pycache__/__init__.cpython-310.pyc create mode 100644 iotDjangoBackend/iotBackEnd/__pycache__/__init__.cpython-311.pyc create mode 100644 iotDjangoBackend/iotBackEnd/__pycache__/asgi.cpython-310.pyc create mode 100644 iotDjangoBackend/iotBackEnd/__pycache__/asgi.cpython-311.pyc create mode 100644 iotDjangoBackend/iotBackEnd/__pycache__/settings.cpython-311.pyc create mode 100644 iotDjangoBackend/iotBackEnd/__pycache__/urls.cpython-311.pyc create mode 100644 iotDjangoBackend/iotBackEnd/__pycache__/wsgi.cpython-311.pyc create mode 100644 iotDjangoBackend/iotBackEnd/asgi.py create mode 100644 iotDjangoBackend/iotBackEnd/routings.py create mode 100644 iotDjangoBackend/iotBackEnd/settings.py create mode 100644 iotDjangoBackend/iotBackEnd/urls.py create mode 100644 iotDjangoBackend/iotBackEnd/wsgi.py create mode 100644 iotDjangoBackend/manage.py diff --git a/iotDjangoBackend/db.sqlite3 b/iotDjangoBackend/db.sqlite3 new file mode 100644 index 0000000000000000000000000000000000000000..5186b3f3aa2da1e343f3e0c50db85d1a2788abd6 GIT binary patch literal 131072 zcmeI5Yit`=cE>p)MT(Nh(Zlk%n>ZTLQDUyFX!w-qbh}Y(##Up?u`D+c&|o?wM=~9X zlu61DEYOyUlU*cjfo`!2v_PApK!FzRhd!|=whI(n6h&LKyDc^a`q-lVly-sb7A5@>JGzk+SO*XlFA7jC~l$c)7wFdIqyLFDAf_eP!@`J?cMq3?!& zE%?>Jt-#Owzcujjz!l;1zOVOk)bIY*rzb+vTk}GzQLdKsyV`E^hPvC(>*`j$w!70X z*2^VhQ>B$$I+an1N>SadmT$SuC(o_rm)G<1_0^TD*Yonq>iPT|a?EXYfYX?KWwpCd zOgc%hqa=`<$ll*r-W4+)%L3MyYD% z993g8Db}h@z1mcp_jYvFq>`KI#jKt#@T#%wM2|YLj;g)9*mPUgto^tOkj!h5kaTZO z*b}WPv5It^pja#ERc%{Wm4sGEEoL;UHmp+7-qm0k_366rNT>$d;$rc=H%3F!^0ILM z#imxM7}qJk`uV~V(Xjd!_mPMh#QO5fm-6=h#BIp1Qb!_}sY18(y1aU2U0%I@>5}}~ z+REkSwGH{z{D!=Ief`SHD!IIzUtK4u+=*wYwfrmjwfyS2{59K2&2z-%^X%vvm$b6F zvc9r>>C%R|Gk?CT5q4|p@@}!{?;P($kM_c79Dc0e8GS^5 zwZd)tME3S4!y##UT6p)A6IrM64flX_C^|b@qj9HJrxtlzs~2x*_0x&uQoPeFsgYE) zMp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`^FwoNN@`RAOHd&00JNY0w4eaAOHd&00JQJSP-zy{}&$% zK@b4~AOHd&00JNY0w4eaAOHd&00JQJ&c%coS;zv literal 0 HcmV?d00001 diff --git a/iotDjangoBackend/iot/__init__.py b/iotDjangoBackend/iot/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/iotDjangoBackend/iot/__pycache__/__init__.cpython-311.pyc b/iotDjangoBackend/iot/__pycache__/__init__.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2398bb4bf63f5a78ff9a0d2b83a552f2277d67f5 GIT binary patch literal 165 zcmZ3^%ge<81fSaT(m?cM5CH>>P{wCAAY(d13PUi1CZpdter~FM zNoGlYaz)ai#r#0x12ZEd;|B&9QN#=s0{|5$C$Inj literal 0 HcmV?d00001 diff --git a/iotDjangoBackend/iot/__pycache__/admin.cpython-311.pyc b/iotDjangoBackend/iot/__pycache__/admin.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6592dddd84c1f22f6b9f11c2c1079ef568ca31a1 GIT binary patch literal 670 zcmZWmy-pl45FYRD-K|y}S3uI`r$V{{j)p1`5(SDB0Zpj3v6i(tOm@A8?L&f!f(N)N zv{axdU0xwCa6w2pxlKiP(WRn_XO|5@8IM2D=<|$c#@Fq31WvwwlKbD>`4gR58V|ITpTs`% zTteS=9%DB!r){N$G+dgUZeT-7Ws-ABZA58auwjPw9HmFYBzs`yGNBD+LJzX!QA4-uXMig>+FG)Xg$&l%l&8!Sg6i%ZA9G-sW;Oy_3 zEWQ}MIorae=IeVq-O$dn!$kIr6|7r{J%yvTO;;_?w8EdW(Kb3|du4VTXkoYw74N&+ zxl(P+S0?Q^>ppy2^}4RG1e~Hib};n`Arp8#eyS6AIex0sfRI;H_#a06_W9B;Bz`}# bA&};I^aB=dU}5zBvhy8QZ((&@YgyMHxOAd5 literal 0 HcmV?d00001 diff --git a/iotDjangoBackend/iot/__pycache__/apps.cpython-311.pyc b/iotDjangoBackend/iot/__pycache__/apps.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d694ed48b29c598cdb706713cc20fdcd495dc284 GIT binary patch literal 530 zcmZutJ5R$f5I!d<>JtG&r49^?8Ja8%3<#-!KnSS|TNcZWlQxjpA&&v34oFB$Z2boy z#GmO{Wo2S3l&KSTk|H6vv(Mk>d)Rl+tyUd`eBLwnL7Z=rtfW$cg(1KMC{W}>fGmVS zfm5K$9Z=OlPb$Ex*o9aM)hxQb zroO~YjIUGTm!2)^xFq!xOhh_%^L$PEUSJ`=wcIsFJaEj!OSnBE%oMe|HV=Z7c{WKr z&bk9)Upb6Qk4eHXHo}`ojw?5s0C7i{@sG|rdsD4FYix{Ten#bCQy#4yel|S|kQAdPf literal 0 HcmV?d00001 diff --git a/iotDjangoBackend/iot/__pycache__/consumers.cpython-311.pyc b/iotDjangoBackend/iot/__pycache__/consumers.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d749afaa12b17f19bc2df604ddec137eec074834 GIT binary patch literal 2147 zcmbtV&1)M+6rWk`N~@1e6DKlmD3;=ar^&}F;c9ovefU3F#^ z*Fgp!LMt0LHoe%V;!E8W7kVtTl>Q5=po3Tl1lk7orsC$}Q{P*CRI&^`bawZ*^YQk* zH}C!4?6;a0BhX&{XfN!C2>A^Mou;%q$G4!fODtm10x8lQrP!AWQZbYZ1^rM#E-E>N z5{cX)846$mPy6fopHrtAV7i|xY$Dy-J7|BtK1=r;{U**P%UNYRJ6Q%4fOk6K(AawN8;qO2H@?!ssqaQxM znUQ@(m`;iLVT+lL#eAj2^S0}U4bx;LHxu$@!3qmLHGC;=2{fNhr%!H7E;&Uu>E>O> zTr%uQ2-1Y<6pLj$ZyIjiu_xvY$dhg1%B0!OmdKV?{RoU~X1WhA_Cz+@o(zM2@eaT` zX~fQLy|I(4$I?~W(9Uh&+q}24Skp%9+GtgJrfOAZkJr?(x;o~mW6#yZc6>9wp>1i^ z;5r5!#O%fn1{micUuXlF2{EE`-;s>OUx67vW)>X5bPR&P@6u^L6wF(Bh)~Pr;a->j zoj(V1A_A~Zz>%uVFG0W0I3_kQ{t39TOWbbK38~P28qmH~w@>ka$tpzyHVIxyIIQj;eLPCY;?Xk8uk)Y1Pehr-@_H8oXNQ=Xc79>25~c^Xf7 z@zk?q>Pf^)PSuiA_2g9bRwFUAJ+nEpF}pQe4X&4AGMs)A^^()IRe?ANcK=WM?(m5K<;n**`)7y4gn zFfYc8jP3zBL<}(;pb$G4D^3Cu5{F9Uf zVZ?Zl0LwEfx%5Ns%`;W6&jzE1Kn@W{4ra(91aYl9kAWRVK5IP!LeQqgF(!6&uw(oe zF_{S#a#`_yvfD`7k9Zi9!Y~!SN2MQ$jTZGDbHP-kHa+9& z?(KvIKMeP^gHoQSg9^EaRG)J#(03r f{pD|f*89uf&@?dky$G*vye^-r`Lj!c6VLwu!Tryd literal 0 HcmV?d00001 diff --git a/iotDjangoBackend/iot/__pycache__/routing.cpython-311.pyc b/iotDjangoBackend/iot/__pycache__/routing.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3de1be94b6f18f20c7ea5ec8d6e8d1aa4a1e7190 GIT binary patch literal 416 zcmY*TJx{|h5IyIsK0d#}~D0P+3BZ(i~KE6ED>vY1_9@dgwqNgyR{ zLVz07OpMfQn*j1s-R8*h#+ElV Oja?&$okhqh8vg_02X9gU literal 0 HcmV?d00001 diff --git a/iotDjangoBackend/iot/admin.py b/iotDjangoBackend/iot/admin.py new file mode 100644 index 0000000..b92856c --- /dev/null +++ b/iotDjangoBackend/iot/admin.py @@ -0,0 +1,8 @@ +from django.contrib import admin +from .models import EspMsgTest + +class EspMsgTestAdmin(admin.ModelAdmin): + list_display = ['content'] + + +admin.site.register(EspMsgTest, EspMsgTestAdmin) \ No newline at end of file diff --git a/iotDjangoBackend/iot/apps.py b/iotDjangoBackend/iot/apps.py new file mode 100644 index 0000000..7e0b434 --- /dev/null +++ b/iotDjangoBackend/iot/apps.py @@ -0,0 +1,6 @@ +from django.apps import AppConfig + + +class IotConfig(AppConfig): + default_auto_field = "django.db.models.BigAutoField" + name = "iot" diff --git a/iotDjangoBackend/iot/consumers.py b/iotDjangoBackend/iot/consumers.py new file mode 100644 index 0000000..bb86772 --- /dev/null +++ b/iotDjangoBackend/iot/consumers.py @@ -0,0 +1,30 @@ +from channels.generic.websocket import WebsocketConsumer +from iot.models import EspMsgTest +from asgiref.sync import async_to_sync + +class iotConsumer(WebsocketConsumer): + def connect(self): + + + self.accept() # 接受 WebSocket 连接 + + + def disconnect(self, close_code): + + pass + + def receive(self, text_data): + + + if text_data == "wokao": + object = EspMsgTest(content="WOKAO") + object.save() + + else : + object = EspMsgTest(content="NOBODY") + object.save() + + + def send_message(self, message): + + self.send(text_data=message) \ No newline at end of file diff --git a/iotDjangoBackend/iot/migrations/0001_initial.py b/iotDjangoBackend/iot/migrations/0001_initial.py new file mode 100644 index 0000000..730d3a0 --- /dev/null +++ b/iotDjangoBackend/iot/migrations/0001_initial.py @@ -0,0 +1,24 @@ +# Generated by Django 5.0.6 on 2024-06-16 07:32 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='EspMsgTest', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('content', models.CharField(db_column='报警信息', max_length=100)), + ], + options={ + 'db_table': 'warning', + }, + ), + ] diff --git a/iotDjangoBackend/iot/migrations/__init__.py b/iotDjangoBackend/iot/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/iotDjangoBackend/iot/migrations/__pycache__/0001_initial.cpython-311.pyc b/iotDjangoBackend/iot/migrations/__pycache__/0001_initial.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..01ba6f861ea1a35910d0fc368db819d9e10bdaa4 GIT binary patch literal 1021 zcmZt^OH30%bY{2RcDF530%@Z48xEEL#XB)k6oL^BiZ$8GX1g;i3;U_NTNDol6Awl& z#KgeWgEa<>9=&<>xFkK0Igx0H+}6N}lW(>ZWAM$)oA;Y}-w%a?f&dC{-T9h;&=1aZ zA$?37j03Tb2qM@<4py-vr~*a;nnFZ)frv=)qS$@Z0&4SwQ$>=xk1FYXuC547aV*o< zL(6jmCOICVc3^a0@;eCz?t?dg))7T2CP)$t0F?S3Ru$3%iJW2bOgDo$ zrrZu1Gl4lrgOCXpnPkHBtxAgJ^=9a4hEMg75|(TDmZSSC+7ex1azK4cx2>m?<(H{n z_X4W9xr?CJw|9HbKkpL|K;>jo*9^~YIxZAZf1=scHNyp# z1#zg?ZTR7_?z@(2Rz#LczLe%IYLkFvyhc*+*-DOOwZxsKF-6m${!N<#o!7KSP2J|N zfXi5}6+)0KPiTX>gt~@B1E2SlW_ag(US5{JX_+@5-%0L_$rB5@-ys#RL62Mg z5gmXjI-063cn+isyHW15s&cZMj_<`kMMa7^zz1 z`cWy^E(PsU5cP&T#j{a)cw@3%9{%zyy7wR|*S5>GcDWYyK8(|1e^0ES;<=6KSQG|& z;({zIzY(BAj$$#_C#~M$%fH->ZWe|?CX2djdZVPCR4^%8C;m&^EU~=;)KPZ4(~s-^ qAg~xtPy-Z;7~@z%xDuhOr*|y%VJSwZ(VEik9sJD|hyT$ge*XaPQW^yS literal 0 HcmV?d00001 diff --git a/iotDjangoBackend/iot/migrations/__pycache__/__init__.cpython-311.pyc b/iotDjangoBackend/iot/migrations/__pycache__/__init__.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5101c2dcd5af9074af402b3028d1f10f64d5db01 GIT binary patch literal 176 zcmZ3^%ge<81fSaT(m?cM5CH>>P{wCAAY(d13PUi1CZpd2KczG$)vkyYXeP+kVtyd;ftit!@dE>lC}IYR0RU3{EGGZ} literal 0 HcmV?d00001 diff --git a/iotDjangoBackend/iot/models.py b/iotDjangoBackend/iot/models.py new file mode 100644 index 0000000..983e00c --- /dev/null +++ b/iotDjangoBackend/iot/models.py @@ -0,0 +1,10 @@ +from django.db import models +from datetime import datetime +# Create your models here. + +class EspMsgTest(models.Model): + + content = models.CharField(max_length=100, db_column='报警信息') + + class Meta: + db_table = 'warning' \ No newline at end of file diff --git a/iotDjangoBackend/iot/routing.py b/iotDjangoBackend/iot/routing.py new file mode 100644 index 0000000..acc7d2b --- /dev/null +++ b/iotDjangoBackend/iot/routing.py @@ -0,0 +1,7 @@ +from django.urls import re_path + +from .consumers import iotConsumer + +websocket_urlpatterns = [ + re_path(r'', iotConsumer.as_asgi()), +] \ No newline at end of file diff --git a/iotDjangoBackend/iot/tests.py b/iotDjangoBackend/iot/tests.py new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/iotDjangoBackend/iot/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/iotDjangoBackend/iot/views.py b/iotDjangoBackend/iot/views.py new file mode 100644 index 0000000..b7cae0d --- /dev/null +++ b/iotDjangoBackend/iot/views.py @@ -0,0 +1,8 @@ +from django.http import HttpResponse +from django.shortcuts import render + +# Create your views here. + +def iot_view(request): + # 你的视图逻辑 + return HttpResponse("This is the /iot/ endpoint.") \ No newline at end of file diff --git a/iotDjangoBackend/iotBackEnd/__init__.py b/iotDjangoBackend/iotBackEnd/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/iotDjangoBackend/iotBackEnd/__pycache__/__init__.cpython-310.pyc b/iotDjangoBackend/iotBackEnd/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..badcfba9a65b055f83d13b333611d2711c1aa2f2 GIT binary patch literal 156 zcmd1j<>g`kf=}&vX(0MBh(HF6K#l_t7qb9~6oz01O-8?!3`HPe1o6vWKO;XkRlg*& zBtJPLF;71;zeG1VKR35DFEcr@Br`uxHz_eWJ2fu_B;y2Rx&oQ;@tJv>P{wCAAY(d13PUi1CZpdGUMYj^D;}~+}N#m5)<5)#8U3Xo?H1m(a4)|v(_7EZ^frgByY;a((~C!Mz3DD+hd7zH)iz3%PRR6;6iEpnF*c>%*;WnkqTY zCUmSc&6It|($h`JX`$5#q&5tKZA;-(p$r&mr$Fa#m=Nq(0A+?UnkzmNuqNOP1U+Lq zt6h@i!0Bkjib7;5vzd~k5#qhaK)KRDGl?@XXM0Cg2%00KwGS!n}+ku2K{7 z6DB9>Z%(PoBaqRH@Od;<=T=1=3ZX7?kTzmwl10G}VFSXu#S`P7G${RrQzc zTdcuq*-8>5BS}i4Oxc`MQufm+lM;jpHKvY_HNn!$&fFbh21es(I=Y%g-Kc!M+b0YQ z)6L4(U))czF=17dZdK+ECU*<$SC$sYvrH>l2AJ%E*s_88tSCEo2>$BmCwRXWKVM;= za)@k(JY%{MqOM^R^O;->#@aD*3X)fz#RS%!42z4>e?6bCH!k9trzkwfZ~JZ+zkV&d R?lSRRLOlG5OMZ8M{Q=1d8SMZ7 literal 0 HcmV?d00001 diff --git a/iotDjangoBackend/iotBackEnd/__pycache__/asgi.cpython-311.pyc b/iotDjangoBackend/iotBackEnd/__pycache__/asgi.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9f349af69c1eb046886771c191e42b5741cd6543 GIT binary patch literal 1284 zcmZt_O>Z1E)HC}ryR#ojQ&JGBDid*uM0Sb?K}`%6{20x-zdsRli!$6_7i=6V?1$ z!B=@ba(!?Gb`EbuO}|;tHQtKae%nIKI$D^8{&{gm-QH=Py5}}R7qBM7LN;Rd(VZE8 z4#dTbL50=BrdEPYoEi-E?`Z@JVzTp+4B;AiP~MX+I*S2>)p*Q97xd*2e>a4 z4yFE@1TQuO#j%n{EYKa--O`wS7t4etSPvPVoFSZ(L(VWsFu{?eBhJ=1J7ydo6BQOJ zK_W)+!2yY59tK2*QXCwBzi%K=Bo)J zM??(dET=$59uwZ@orm5~o@nV&7IS$TF`+$@3_{QS+mvEw)ym%=Fx{i9Pexq#Ze;?h za!mAa)y|i`RZ`19^8M48?a7g5Dz87^dpaS(@b3CZ51)mUa&|%#>uM+wh~G1=O}Kyg zT|Qxli40zVcBD820f!>V?>&C9zO%X8>u&7tZ|!V$d(ULg6-Pz(}Ct!#>r*KZuI-p!p}4=U2@<+e=n>ZC6DVlX5^FrIW2K~^NE{}PLnTG-LbB89<`tkv zao)I9d&Lxvuu{|6abOXnd& zpQiKhUz<0`K6C#>%YUHd^j;@@_~aGZevP(Mw4I^mxO&$7zJ1mnx8JmJ+QymtAax(S za`9^yXA3Lo!b(=V^Fuvresoo`>+UrIbX6)ZR<9AD%ZjsN!&O)8E95Mct_>PD%v2vj GP5uD}CvemN literal 0 HcmV?d00001 diff --git a/iotDjangoBackend/iotBackEnd/__pycache__/settings.cpython-311.pyc b/iotDjangoBackend/iotBackEnd/__pycache__/settings.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9a4b8d1cc053cdace6550d5ccf0685cfcb33ad42 GIT binary patch literal 2799 zcmb7G-EZ4e6u0x~q)D1|=~}h{E<=M1>a^>+6$E2$;&#!}B*e}NezDx#o5Y9 zKSex&!~<`<@PH5kA^r>gf`O2z{8Wi2c(TMBPaG#s8?s4^$T>Opo^yWp-1FsppH3$U z_^UdKP*{wkh)AJmmlP9S0>!=|#UzT0bHG!;r%*ynqa>^%$lptSLn_fktMlGSU>Cwrtt71I;(+fdxQxfV;`8F}J{a2VgbB#I&Nr37Tvx zhEBs{_Y^o&QSsa00#5d9yKlW)EFz7Hy-iw5{UA=i(UN?qRw! zP*qx0ESoku=Xa9fA|O>v`jM;-u=Rh=GI3|>pg;W77DzYJknNtc9YjIVE!-ZMc=h^Q z*4pO#n}@jYcOD5YdA&e6 z3lMTf?)NRGV%Q}^?g^d{WQg&!A1tgPyun?k3}-JfiRiTP-Z;urR=1vW2?*rFL+C+hCFY|YQ`T_3@Ar%~ zWj8;SfPo1aDF#3`*7_>6Dsun`SVxmqV#=eg6#}v4E{qE0i7i2swZSjLvpkQ6szE4JbH z!kY7nY@trKclc2KaGz@mAGa#?#@+QB8#gy^-QId<%}K4VG3#qv%*JhIYfJev1rsFZ z#<<#UrN+6D8oLLy#dA%UYOp-NUvGl{_v*X=Q>NY&%y}3&&b^s{j7qXETh?R4L=ucO z1&tbyX<680ZGT`4Y|JZ~qRM`!Js4{krgP^-k@gf_(FR%->s`BdZvVlH+K)T15%_ox zaQ8(4Y6A_MO8Z%aDArd8mK$yfB_|FqALzuQ^Kt+SInxXT1B%&Jy3nb{j)GNGD=fQl zNrLx^B)RcEOm9^=FvAd9my#rZwE6ocwhZ+Vc4K`QSGw&|+bqxd733y)uGHiN=|1j${r_)bto_jN=vG&Z`ItG&j}*jMF59N{^{;QncHDoRY3yey0lZ_s^uSu zzx=n{-yalvhK7riIxoVsS@nnOKo17rYA{}WN$`K+>{ZG1kN>9LgG3Bee8(&Tp8p@p zdH~c5lO*Ydl4Qgqe6mcCFFhrerynmyq_Ush{DS)I&gXZ2n_Ky1Zsq5>tH1is^Pha>N$$$Y;^s;2 z)sx(!myT!S9^sR4Vx<2Xk(hs)6}@l>FsRX@F}?V3deIy&7SmTk5D@Pgky{?7PgA*J g;&g6)NS(rMV_u5LEWsU;#Kq00#KQP7S0TRt07PD)qW}N^ literal 0 HcmV?d00001 diff --git a/iotDjangoBackend/iotBackEnd/__pycache__/urls.cpython-311.pyc b/iotDjangoBackend/iotBackEnd/__pycache__/urls.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0bea711c30a291c7ac91bd7d3752a63bd9b4d068 GIT binary patch literal 1058 zcmb7Dzi-qq6n1jCYe{LlGB6l*xQo;#fYjyqC4RJ`5<&>*a?90?eRsabc4Yg2GL;EN zhD!VgAjCgYBnFg~iS0zU4v6PmA{|Ib;5gB<^ZdQW1XHAK)0Jme!5(17{lW_@_vs;&2c`w8CJ7<#=0+I)hd z7I_7m;qK!HI8}1MhZ9XKR}v4D#$4GuBt6)Y6z5uvS!&}jd^%!yZ=$oDSj)6DdpP69 zVyz~Y84N%MTZNx-_T0pH8&HJO408#9Vg{XOj2MOuW8DzL7+IT}Zjw-ynwXA>9I858 zszkzMvKe1atjc+666c&ic$0)%FNgpv(+#&LGA&t`VN1{}F}_VHCK7XzD{Z?N53~|k z9QH|`SDQ1MrT^8+-(}zun9C53Lb9VyyS-lJHBy4DV@U+N(ROw_3h!pbn2mi%jLxC{ zjfJu!rX7*EWL(p^4_N=h#`(v@^c_ei`h(GqOtT5)atI=n@my-I$hAH@r7#$%KzW=m z>qK}^N!gvrH7iH#1g}X}zU!qZ|IBtjQ^N!VtRuDEMv2>wqVT(G%g8I5gbFUf2%O?C zTjer&7%dhH{XXnipJ~JM zys5wH1ykfc77 literal 0 HcmV?d00001 diff --git a/iotDjangoBackend/iotBackEnd/__pycache__/wsgi.cpython-311.pyc b/iotDjangoBackend/iotBackEnd/__pycache__/wsgi.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..78c88b7ac99dfbad44398e78df6a928e004e916a GIT binary patch literal 700 zcmY*Xzi$&U6n?%-8@SR40qty6T_TaYGIRli1ZolmK|7=fl;z@{oy5UspUzH7J9R)} zVrFG3Lj7k_R0-*(NK9-I-8$jR4-uYy{`LI6?|aYpZGGJXYkxk;&SwPhE8i@vFkf8v z?BWYhXaPmk5vYai>^Cz64lwuJZY~x_&|0NV z6UwWnnfJC?Z{SGD4)5ZQN-yC zy3B<6S-2!4+uVEke7}AWHmiq+js1Eve0{L@=2i9d{=WkFni<1oSC@-fF$}GWFw7jK zv%51beq>YdbL7;uTv?IHAy1XeJR3+^hYW(7a=rpil{Jwe7Fb5JG-5? xF+3Xm-^bv5^nSv|57-!O`lFrdCDg8