From 54e7ae3c5608844b9e28aa8685296c4d3ed4eadc Mon Sep 17 00:00:00 2001 From: Zney4 <134953901+Zney4@users.noreply.github.com> Date: Mon, 2 Sep 2024 19:14:13 +0300 Subject: [PATCH 01/37] 1 --- .idea/.gitignore | 3 ++ .idea/django-orm-watching-storage.iml | 14 +++++++ .idea/inspectionProfiles/Project_Default.xml | 12 ++++++ .../inspectionProfiles/profiles_settings.xml | 6 +++ .idea/misc.xml | 7 ++++ .idea/modules.xml | 8 ++++ .idea/vcs.xml | 6 +++ .../__pycache__/__init__.cpython-310.pyc | Bin 0 -> 198 bytes .../active_passcards_view.cpython-310.pyc | Bin 0 -> 587 bytes datacenter/__pycache__/models.cpython-310.pyc | Bin 0 -> 2314 bytes .../passcard_info_view.cpython-310.pyc | Bin 0 -> 981 bytes .../storage_information_view.cpython-310.pyc | Bin 0 -> 984 bytes datacenter/active_passcards_view.py | 7 ++-- .../__pycache__/__init__.cpython-310.pyc | Bin 0 -> 209 bytes datacenter/models.py | 39 +++++++++++++++--- datacenter/passcard_info_view.py | 36 +++++++++------- datacenter/storage_information_view.py | 30 +++++++++----- main.py | 4 +- project/__pycache__/settings.cpython-310.pyc | Bin 0 -> 906 bytes project/__pycache__/urls.cpython-310.pyc | Bin 0 -> 621 bytes project/settings.py | 34 +++++++-------- project/urls.py | 6 +-- 22 files changed, 155 insertions(+), 57 deletions(-) create mode 100644 .idea/.gitignore create mode 100644 .idea/django-orm-watching-storage.iml create mode 100644 .idea/inspectionProfiles/Project_Default.xml create mode 100644 .idea/inspectionProfiles/profiles_settings.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml create mode 100644 datacenter/__pycache__/__init__.cpython-310.pyc create mode 100644 datacenter/__pycache__/active_passcards_view.cpython-310.pyc create mode 100644 datacenter/__pycache__/models.cpython-310.pyc create mode 100644 datacenter/__pycache__/passcard_info_view.cpython-310.pyc create mode 100644 datacenter/__pycache__/storage_information_view.cpython-310.pyc create mode 100644 datacenter/migrations/__pycache__/__init__.cpython-310.pyc create mode 100644 project/__pycache__/settings.cpython-310.pyc create mode 100644 project/__pycache__/urls.cpython-310.pyc diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 000000000..26d33521a --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/django-orm-watching-storage.iml b/.idea/django-orm-watching-storage.iml new file mode 100644 index 000000000..8e5446ac9 --- /dev/null +++ b/.idea/django-orm-watching-storage.iml @@ -0,0 +1,14 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 000000000..4aae69f49 --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,12 @@ + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 000000000..105ce2da2 --- /dev/null +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 000000000..fccf8de16 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,7 @@ + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 000000000..d506e018c --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 000000000..35eb1ddfb --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/datacenter/__pycache__/__init__.cpython-310.pyc b/datacenter/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a4d2f4d994b10bfc4d460d1a1190a54d026f10e9 GIT binary patch literal 198 zcmd1j<>g`kf{M0TX(0MBh(HF6K#l_t7qb9~6oz01O-8?!3`HPe1o0K5*V!s2v^ce> zI3~L^Cowz5KQGm#D6=dz=E9T<`!4Ld*nDBng{>F%UTnJ99aB)0pOudhQly}zb8#o?D2kAvhDZr1EK8@wyWIJ(y~oTRUpktQB2q+` zCO;uRAQVxO-{5QArpgaU4dW#O1hbm)8+&)&dtTe?J!KT1RxbCxa>o8N&HWJ6tW)9| z70ooyS;1q@8!QNmSa>XRSp;!FIMA(+ENwSiqBM^cq zwSkm)Z$lCaC^sl^m5O5%J`tL0aly~HmUEu*GvVZ%nC9YK5=(3A9Zh?Z;ZUV6J2dt3 z&2u>YPl~569=;ijU6DrtH2&(g-JO`!VIA&exibKbf=JeFFb6Y(4nn^xwWTx1?i+(= z)c->&8!wX`G=RzeELZ!UZ^HabEqbzE{5%9~PgJDOgXE=!q&vwr`>6 zA1RlPvvSl&XF-ijqLovrAsR>?DjptY=4dcIsULaqUmA(np|T_b5nOd8^r+d2!ua{! z&_Q9f$k literal 0 HcmV?d00001 diff --git a/datacenter/__pycache__/models.cpython-310.pyc b/datacenter/__pycache__/models.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4df6d6eca31829f604b890712abf4a7edae24a35 GIT binary patch literal 2314 zcmZ`*&2QX96rUM?tk>}-o0Nv~aaf=r3?v{VE~rA3gm6GCNC_OQl`OL}*?8-<+wr)e z+s%bk;(&VNR#i%m{R5B?qMSKy4qWC4r~CmNOL=d+X_L@en&&q&&*R^F@AsZvv|2ua zEBouu?XW?}-#9sW*)aJSM!5xo6HYTSq7kL2vy6?b$TGT>*&`=%jBaOkWPe7u!`)ki zyMhkgeJg6fN`rf_;>}h(Zf}yXc?2hukZN~SaFLauHM63hWGWpAn0R;}7rE&6(eUK; z7~BS|3KCIHA||Y%%_(QMY2<+Ja*NxbH$e9QlEvNIENYq=z=0i~H@Sa{M00!&-~`(H zDk;l;BKZcqy}`wHQe|rEJ|IadRm6F*d-MmqFJ#&uCEvxF$OmdiyH%cEtHjYG+@cbr z+NU6nFVq=~H5lau5EC*a(gjI3QKxqxxOW*KVBPUt=gl-v`YOFHLU>OzE#rEo{bDy4 zGR~8c07P~vvhDjsF2Z^La6J9P-q)p&W$#LrC0BZ1=3-sKA-(BO)8D7R9_~+noBlj~ zaQOYd3sdwiJWgJPwSqm|u6^>@;Iuu`f*CIivqiAwq+S3>sc?5tkBp&M~r zDjCNubj1bXQkMpF+&&K6>dc^v(Tok)IM#j~!x>d3Ko8>hT9stzMjT6wiw-_1icBQ= zMk+Ec@oe2%Pn6h#^qV#9_oaXZ9w$mS*LD(VmLu;f<_owZ=iwoF4h06}gjm9<0|F>c z$^e8%0)RXZBVcCd+2q2wK8swUrj=Dw>cGB7B7a6eB;8zH15r>jKWfdWHqYmH0F+zc zEj|zTHeZ0mx3%+4TBd4CB1|A(v&ds838AnK?7Ygd|4|B^GL(7;6i$bRN<#*OvS8S9 ziKA}cA$J*+fwf6YIlw)1y5oyCD{LjQNfrzfl9xeICLsIN+}S?8Kn|>XWRFgu>O$HLZHeacRTQs) z&@EM{B#TSYFLGXnOtx{=zmAECu@#*`s)K=0F|TBz(jxDGap{3rVm4*}+SYif27A(| zk0_5XOd$3#gLoa32|XZykWCn;FOoe=(TTMW4HxIj&~#zVhBX`4>OJTjXay^v*>|z2 zI^DDlkvqBs2Uh6e;SZe(OBEWxFVhF$)@v})R+_8OF)qrBxX_sSt(~2slBI5p(!5fl zJnQsAo#4lQzX1=|bwxeuv4DB>0v(^PeLrJ+Dq)BX!(rUVw#X?Yhnx(-gkAxc?z67M zw?J=w9dA~R`Yq74cO3q+Fk8?#>&#_EK6npoO~0}MB=oCuHM~S-E=rD^SPnU3jF9rSk>; fIvBj>pr>Kb-lh8U^AUcE4Os*85%B1ewH*8hzHJ#% literal 0 HcmV?d00001 diff --git a/datacenter/__pycache__/passcard_info_view.cpython-310.pyc b/datacenter/__pycache__/passcard_info_view.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4a408e8a01794ca11c91530b0e8be434c96e5de4 GIT binary patch literal 981 zcmY*XyKWRQ6tz7wp4rJHBnU*1@&j9BMUe_2gp||)iAOOSv>L|V-Pz1zV|x>bW*b6> z(ov?!((wT_2>6CgLF0ykiVvVfaP7@PV#(LXk2~kwbEjTj4iSv%`?ubE2caKkb9oTh zJb)>mKwyaB0+l$%*kA&f#KdB!a7s6JOE329-Ysb9$G*j05tOaCWic&+IAA^t-k>;S z^f79;e!`bg8|&avDrJ@m2H1O+%UrdIrh-?D3%%Cos$0Jp@(dQy-MX^{uUbW&rG?5% zZqm(qR9AdAGolxx1t5UA4O0pTeKa8oDcoR&PsqekWatdt#$n_HPu#}cLC-fPp7I)R zNRRP^TI2)r8*&yjwDHbbjo;99G{u0!DPqp4GX+cb*BYlG%snNOKrJ$ScJKXWdlkfQ?0}^16z{Ty~`rY1QX#B1{qbh8n=(BC~s79Fj-Z z{~hF2ukH*~S+pbJL4q(g2xuzO{@gjKX)iB;O;B@XIu9Q5^kB|T)6odr*4KKqC{xv4 zh|$ZyYw5a0UG;?vdF__=1>YZY5NYfckqJg;Oy|n9XIJfC)E9e}N&8t11;11ukhlfU ze~ln)-%XxME@ZMdF4Dc^Va0bue!!F2yV=*-r}N|4=h?^Em-E->ZHS zm}2)g{SyWe7PsL+dnsP~&(JBMr-i)a_Uc?(M-FPCvayoZG24^)=EdDu<%R4lep%ZO q=zglWITAjwSSoALrLYbcI=BavizV`whJxfDl4z=TZs55Cugcaj!`o`>=g?P~{fNhFB0I zLvQ2IL6pu2e1=67Q4)?NlYvz%&Yy_x7cGr9mb)>J`3WY2#WAEiaUk>2=zL@ zz$@zEHay6b$}?F2_MVig)Bt=*c|j$h4ikCCbXik#)_hL{r~5fJ=F1Vlw*zYzmf|1= zXo@weaOIf1-{PsG-O4>9+N=B-p1O^*hn{Xvi4Gc4g{OGxHTbLpII30}uOVmM#%;VU zG{b;bXHf44GK0#W-zeM$mw4*ywFVWW@lRc-#oM=u(riqNG}Ap2uS||aO1Y+z7HzZy zu+@geNM^beyp2kgDlIcUpzS6XJk6O6-P{C3Fk5 zfp}KYT&vbUEExm>*O{hUQsb3?n_kccl0F|%NPh+Nc!LX_vPJp!yj(ZYJd4}ll7}D{z{m^z z5y@@X|2+n=dpCKks8q@Eh-JsgLr(W(Ii|_{{rubf^ZDug%ly;)>-nqmH_1>6TX0fT zK$_SAR(2+t&W}ny*jcib00&ua118rH2-VO@fB3S!j$ONHu93O}g5Winp%Y=^_>P0S z*vI6Le?cO0(RJl*IMR#a&HwTGwJ0c4(mb0*hc*_8_SKP)Iv;6e*^6&3e~)y@RR8iu oFS@j5j7{fk087&qaSJxu@E!yjF?!#;0A&ois0-g`kf{M0TX(0MBh(HF6K#l_t7qb9~6oz01O-8?!3`HPe1o5>H$aS`g2`x@7 zDvrr6%}LCT@y| minutes + + def is_visit_long_now(self): + now = datetime.datetime.now(timezone.utc) + minutes = 60 + duration = (now - localtime(self.entered_at)).total_seconds() + return duration // 60 > minutes diff --git a/datacenter/passcard_info_view.py b/datacenter/passcard_info_view.py index 4c763f589..6cc6981a9 100644 --- a/datacenter/passcard_info_view.py +++ b/datacenter/passcard_info_view.py @@ -1,21 +1,27 @@ from datacenter.models import Passcard from datacenter.models import Visit -from django.shortcuts import render +from django.shortcuts import render, get_object_or_404 +from django.utils.timezone import localtime +from datetime import timezone +import datetime def passcard_info_view(request, passcode): - passcard = Passcard.objects.all()[0] - # Программируем здесь + this_passcard_visits = [] + passcard = get_object_or_404(Passcard, passcode=passcode) + visits = Visit.objects.filter(passcard=passcard) - this_passcard_visits = [ - { - 'entered_at': '11-04-2018', - 'duration': '25:03', - 'is_strange': False - }, - ] - context = { - 'passcard': passcard, - 'this_passcard_visits': this_passcard_visits - } - return render(request, 'passcard_info.html', context) + for visit in visits: + entered = localtime(visit.entered_at) + leave = localtime(visit.leaved_at) + + this_passcard_visits.append( + { + "entered_at": entered, + "duration": visit.format_duration(leave - entered), + "is_strange": visit.is_visit_long(), + } + ) + + context = {"passcard": passcard, "this_passcard_visits": this_passcard_visits} + return render(request, "passcard_info.html", context) diff --git a/datacenter/storage_information_view.py b/datacenter/storage_information_view.py index 7ea1938d5..161932bb7 100644 --- a/datacenter/storage_information_view.py +++ b/datacenter/storage_information_view.py @@ -1,19 +1,29 @@ from datacenter.models import Passcard from datacenter.models import Visit from django.shortcuts import render +from django.utils.timezone import localtime +from datetime import timezone +import datetime def storage_information_view(request): - # Программируем здесь + non_closed_visits = [] + not_leaved_visit = Visit.objects.filter(leaved_at=None) + now = datetime.datetime.now(timezone.utc) + + for visit in not_leaved_visit: + entered = localtime(visit.entered_at) + + non_closed_visits.append( + { + "who_entered": visit.passcard.owner_name, + "entered_at": entered, + "duration": visit.format_duration(now - entered), + "is_strange": visit.is_visit_long_now(), + } + ) - non_closed_visits = [ - { - 'who_entered': 'Richard Shaw', - 'entered_at': '11-04-2018 25:34', - 'duration': '25:03', - } - ] context = { - 'non_closed_visits': non_closed_visits, # не закрытые посещения + "non_closed_visits": non_closed_visits, } - return render(request, 'storage_information.html', context) + return render(request, "storage_information.html", context) diff --git a/main.py b/main.py index 57cae1a82..f256694a6 100644 --- a/main.py +++ b/main.py @@ -2,5 +2,5 @@ from django.core.management import execute_from_command_line -os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'project.settings') -execute_from_command_line('manage.py runserver 0.0.0.0:8000'.split()) +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "project.settings") +execute_from_command_line("manage.py runserver 0.0.0.0:8000".split()) diff --git a/project/__pycache__/settings.cpython-310.pyc b/project/__pycache__/settings.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..bc3cbdc4534a542957d5940280539149b82f7553 GIT binary patch literal 906 zcmYjPOK;Oa5cVsH^X!WrKpZ$B1t}?y_JR4id7`b^={oHPHen(tL6wC zkhpT}fgbq*a6rIsNUwY4#1G(tgvusOmF~!+*>Ap`9e=Yyv6$o7dVl-t;f~00zh;}8 zOJ?7}(Lmc9L4su99B9c%FrBMdSD0`Of^N>e5kB0)vLlG6Ago-eQN(@P3ZjkvT z-|$(SJLhKx^Jry`7jPb}o(mq23TW+2WT%R(MhUIM6|@0YS-ggB!F9x&TzT_1>x9#2 z2H`^|@#D#TG;qdVP(=sT1IHcWF(TD4Ah8!=^4hmUa_R=5_jt1D9$|MF2K{kdMfiB+ zjH^N9L1}0E$u`U_lQiWePK018ApOx!IZe|*Ycw@LrI)&CQK_RF%xg-UAzc#~RPHFI zxvv{4%poUsTs)3(1ak)Hw3HgK+rXL>!YCMEH?Ag;PbmLjvbAVB#-q@8V!Uj9kx=J9 zWi8T#X0Mr~EYi%bQriQX3MI8^m{e9e9eWl{Qc+Tgl1ULHQ4r#-c0kz7IcHVvA! zK$}TrvCCy9sNH(>P@~0`qBXio1K2fP1&q^d0~_jW4Cxuif^=O4b*0;~Y^7`IcD)H& z>Sr#x#~#Pr{c%}Td)n&~9Fg8I@tt8$A7eG@ALHKiW{q&iG#@T@HMGNa2zw7J+xCQKVzaMK7P)#3&}QfGAD=vzclHu bbeYae!pzdbT~QEAEGzw!E~V@hDhvMsM}!$8 literal 0 HcmV?d00001 diff --git a/project/__pycache__/urls.cpython-310.pyc b/project/__pycache__/urls.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f26ff5d0da4d8e645477532bbb230b3c3f9a1637 GIT binary patch literal 621 zcmZuvze~eF6uxVcCjA9P5p*aBP90kJQi`Cn4&rhI!jZeSX_H*JOImc)MG!at3I6~c zMEx7mwX2hZqod$U+Cp1;A&>8U@5}q%L8qqSW`FdawBg49%4@_cW#7$;!%<{~9)Bs!DVAcW`xW`JdC((Zdzrt$QY$vJ*noyT(Tt_9q>(WIVaG5Z?$8i2XiRA2_PwyzSPZok*{OYV bbUm}$fnc%EJ8+GVszNBEGR__?jn>~kYeL5O literal 0 HcmV?d00001 diff --git a/project/settings.py b/project/settings.py index d88f76597..24c16811e 100644 --- a/project/settings.py +++ b/project/settings.py @@ -1,43 +1,43 @@ import os DATABASES = { - 'default': { - 'ENGINE': 'django.db.backends.postgresql_psycopg2', - 'HOST': '', - 'PORT': '', - 'NAME': '', - 'USER': '', - 'PASSWORD': '', + "default": { + "ENGINE": "django.db.backends.postgresql_psycopg2", + "HOST": "checkpoint.devman.org", + "PORT": "5434", + "NAME": "checkpoint", + "USER": "guard", + "PASSWORD": "osim5", } } -INSTALLED_APPS = ['datacenter'] +INSTALLED_APPS = ["datacenter"] -SECRET_KEY = 'REPLACE_ME' +SECRET_KEY = "REPLACE_ME" DEBUG = True -ROOT_URLCONF = 'project.urls' +ROOT_URLCONF = "project.urls" -ALLOWED_HOSTS = ['*'] +ALLOWED_HOSTS = ["*"] BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) TEMPLATES = [ { - 'BACKEND': 'django.template.backends.django.DjangoTemplates', - 'DIRS': [os.path.join(BASE_DIR, 'templates')], - 'APP_DIRS': True, + "BACKEND": "django.template.backends.django.DjangoTemplates", + "DIRS": [os.path.join(BASE_DIR, "templates")], + "APP_DIRS": True, }, ] USE_L10N = True -LANGUAGE_CODE = 'ru-ru' +LANGUAGE_CODE = "ru-ru" -TIME_ZONE = 'Europe/Moscow' +TIME_ZONE = "Europe/Moscow" USE_TZ = True -DEFAULT_AUTO_FIELD = 'django.db.models.AutoField' +DEFAULT_AUTO_FIELD = "django.db.models.AutoField" diff --git a/project/urls.py b/project/urls.py index a6a97e63b..64bec13d7 100644 --- a/project/urls.py +++ b/project/urls.py @@ -4,7 +4,7 @@ from django.urls import path urlpatterns = [ - path('', active_passcards_view, name='active_passcards'), - path('storage_information', storage_information_view, name='storage_information'), - path('passcard_info/', passcard_info_view, name='passcard_info'), + path("", active_passcards_view, name="active_passcards"), + path("storage_information", storage_information_view, name="storage_information"), + path("passcard_info/", passcard_info_view, name="passcard_info"), ] From ada686818217b16675ecc6f3831854d13632af0c Mon Sep 17 00:00:00 2001 From: Zney4 <134953901+Zney4@users.noreply.github.com> Date: Wed, 4 Sep 2024 18:11:49 +0300 Subject: [PATCH 02/37] Delete datacenter/__pycache__ directory --- datacenter/__pycache__/__init__.cpython-310.pyc | Bin 198 -> 0 bytes .../active_passcards_view.cpython-310.pyc | Bin 587 -> 0 bytes datacenter/__pycache__/models.cpython-310.pyc | Bin 2314 -> 0 bytes .../passcard_info_view.cpython-310.pyc | Bin 981 -> 0 bytes .../storage_information_view.cpython-310.pyc | Bin 984 -> 0 bytes 5 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 datacenter/__pycache__/__init__.cpython-310.pyc delete mode 100644 datacenter/__pycache__/active_passcards_view.cpython-310.pyc delete mode 100644 datacenter/__pycache__/models.cpython-310.pyc delete mode 100644 datacenter/__pycache__/passcard_info_view.cpython-310.pyc delete mode 100644 datacenter/__pycache__/storage_information_view.cpython-310.pyc diff --git a/datacenter/__pycache__/__init__.cpython-310.pyc b/datacenter/__pycache__/__init__.cpython-310.pyc deleted file mode 100644 index a4d2f4d994b10bfc4d460d1a1190a54d026f10e9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 198 zcmd1j<>g`kf{M0TX(0MBh(HF6K#l_t7qb9~6oz01O-8?!3`HPe1o0K5*V!s2v^ce> zI3~L^Cowz5KQGm#D6=dz=E9T<`!4Ld*nDBng{>F%UTnJ99aB)0pOudhQly}zb8#o?D2kAvhDZr1EK8@wyWIJ(y~oTRUpktQB2q+` zCO;uRAQVxO-{5QArpgaU4dW#O1hbm)8+&)&dtTe?J!KT1RxbCxa>o8N&HWJ6tW)9| z70ooyS;1q@8!QNmSa>XRSp;!FIMA(+ENwSiqBM^cq zwSkm)Z$lCaC^sl^m5O5%J`tL0aly~HmUEu*GvVZ%nC9YK5=(3A9Zh?Z;ZUV6J2dt3 z&2u>YPl~569=;ijU6DrtH2&(g-JO`!VIA&exibKbf=JeFFb6Y(4nn^xwWTx1?i+(= z)c->&8!wX`G=RzeELZ!UZ^HabEqbzE{5%9~PgJDOgXE=!q&vwr`>6 zA1RlPvvSl&XF-ijqLovrAsR>?DjptY=4dcIsULaqUmA(np|T_b5nOd8^r+d2!ua{! z&_Q9f$k diff --git a/datacenter/__pycache__/models.cpython-310.pyc b/datacenter/__pycache__/models.cpython-310.pyc deleted file mode 100644 index 4df6d6eca31829f604b890712abf4a7edae24a35..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2314 zcmZ`*&2QX96rUM?tk>}-o0Nv~aaf=r3?v{VE~rA3gm6GCNC_OQl`OL}*?8-<+wr)e z+s%bk;(&VNR#i%m{R5B?qMSKy4qWC4r~CmNOL=d+X_L@en&&q&&*R^F@AsZvv|2ua zEBouu?XW?}-#9sW*)aJSM!5xo6HYTSq7kL2vy6?b$TGT>*&`=%jBaOkWPe7u!`)ki zyMhkgeJg6fN`rf_;>}h(Zf}yXc?2hukZN~SaFLauHM63hWGWpAn0R;}7rE&6(eUK; z7~BS|3KCIHA||Y%%_(QMY2<+Ja*NxbH$e9QlEvNIENYq=z=0i~H@Sa{M00!&-~`(H zDk;l;BKZcqy}`wHQe|rEJ|IadRm6F*d-MmqFJ#&uCEvxF$OmdiyH%cEtHjYG+@cbr z+NU6nFVq=~H5lau5EC*a(gjI3QKxqxxOW*KVBPUt=gl-v`YOFHLU>OzE#rEo{bDy4 zGR~8c07P~vvhDjsF2Z^La6J9P-q)p&W$#LrC0BZ1=3-sKA-(BO)8D7R9_~+noBlj~ zaQOYd3sdwiJWgJPwSqm|u6^>@;Iuu`f*CIivqiAwq+S3>sc?5tkBp&M~r zDjCNubj1bXQkMpF+&&K6>dc^v(Tok)IM#j~!x>d3Ko8>hT9stzMjT6wiw-_1icBQ= zMk+Ec@oe2%Pn6h#^qV#9_oaXZ9w$mS*LD(VmLu;f<_owZ=iwoF4h06}gjm9<0|F>c z$^e8%0)RXZBVcCd+2q2wK8swUrj=Dw>cGB7B7a6eB;8zH15r>jKWfdWHqYmH0F+zc zEj|zTHeZ0mx3%+4TBd4CB1|A(v&ds838AnK?7Ygd|4|B^GL(7;6i$bRN<#*OvS8S9 ziKA}cA$J*+fwf6YIlw)1y5oyCD{LjQNfrzfl9xeICLsIN+}S?8Kn|>XWRFgu>O$HLZHeacRTQs) z&@EM{B#TSYFLGXnOtx{=zmAECu@#*`s)K=0F|TBz(jxDGap{3rVm4*}+SYif27A(| zk0_5XOd$3#gLoa32|XZykWCn;FOoe=(TTMW4HxIj&~#zVhBX`4>OJTjXay^v*>|z2 zI^DDlkvqBs2Uh6e;SZe(OBEWxFVhF$)@v})R+_8OF)qrBxX_sSt(~2slBI5p(!5fl zJnQsAo#4lQzX1=|bwxeuv4DB>0v(^PeLrJ+Dq)BX!(rUVw#X?Yhnx(-gkAxc?z67M zw?J=w9dA~R`Yq74cO3q+Fk8?#>&#_EK6npoO~0}MB=oCuHM~S-E=rD^SPnU3jF9rSk>; fIvBj>pr>Kb-lh8U^AUcE4Os*85%B1ewH*8hzHJ#% diff --git a/datacenter/__pycache__/passcard_info_view.cpython-310.pyc b/datacenter/__pycache__/passcard_info_view.cpython-310.pyc deleted file mode 100644 index 4a408e8a01794ca11c91530b0e8be434c96e5de4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 981 zcmY*XyKWRQ6tz7wp4rJHBnU*1@&j9BMUe_2gp||)iAOOSv>L|V-Pz1zV|x>bW*b6> z(ov?!((wT_2>6CgLF0ykiVvVfaP7@PV#(LXk2~kwbEjTj4iSv%`?ubE2caKkb9oTh zJb)>mKwyaB0+l$%*kA&f#KdB!a7s6JOE329-Ysb9$G*j05tOaCWic&+IAA^t-k>;S z^f79;e!`bg8|&avDrJ@m2H1O+%UrdIrh-?D3%%Cos$0Jp@(dQy-MX^{uUbW&rG?5% zZqm(qR9AdAGolxx1t5UA4O0pTeKa8oDcoR&PsqekWatdt#$n_HPu#}cLC-fPp7I)R zNRRP^TI2)r8*&yjwDHbbjo;99G{u0!DPqp4GX+cb*BYlG%snNOKrJ$ScJKXWdlkfQ?0}^16z{Ty~`rY1QX#B1{qbh8n=(BC~s79Fj-Z z{~hF2ukH*~S+pbJL4q(g2xuzO{@gjKX)iB;O;B@XIu9Q5^kB|T)6odr*4KKqC{xv4 zh|$ZyYw5a0UG;?vdF__=1>YZY5NYfckqJg;Oy|n9XIJfC)E9e}N&8t11;11ukhlfU ze~ln)-%XxME@ZMdF4Dc^Va0bue!!F2yV=*-r}N|4=h?^Em-E->ZHS zm}2)g{SyWe7PsL+dnsP~&(JBMr-i)a_Uc?(M-FPCvayoZG24^)=EdDu<%R4lep%ZO q=zglWITAjwSSoALrLYbcI=BavizV`whJxfDl4z=TZs55Cugcaj!`o`>=g?P~{fNhFB0I zLvQ2IL6pu2e1=67Q4)?NlYvz%&Yy_x7cGr9mb)>J`3WY2#WAEiaUk>2=zL@ zz$@zEHay6b$}?F2_MVig)Bt=*c|j$h4ikCCbXik#)_hL{r~5fJ=F1Vlw*zYzmf|1= zXo@weaOIf1-{PsG-O4>9+N=B-p1O^*hn{Xvi4Gc4g{OGxHTbLpII30}uOVmM#%;VU zG{b;bXHf44GK0#W-zeM$mw4*ywFVWW@lRc-#oM=u(riqNG}Ap2uS||aO1Y+z7HzZy zu+@geNM^beyp2kgDlIcUpzS6XJk6O6-P{C3Fk5 zfp}KYT&vbUEExm>*O{hUQsb3?n_kccl0F|%NPh+Nc!LX_vPJp!yj(ZYJd4}ll7}D{z{m^z z5y@@X|2+n=dpCKks8q@Eh-JsgLr(W(Ii|_{{rubf^ZDug%ly;)>-nqmH_1>6TX0fT zK$_SAR(2+t&W}ny*jcib00&ua118rH2-VO@fB3S!j$ONHu93O}g5Winp%Y=^_>P0S z*vI6Le?cO0(RJl*IMR#a&HwTGwJ0c4(mb0*hc*_8_SKP)Iv;6e*^6&3e~)y@RR8iu oFS@j5j7{fk087&qaSJxu@E!yjF?!#;0A&ois0- Date: Wed, 4 Sep 2024 18:12:03 +0300 Subject: [PATCH 03/37] Delete project/__pycache__ directory --- project/__pycache__/settings.cpython-310.pyc | Bin 906 -> 0 bytes project/__pycache__/urls.cpython-310.pyc | Bin 621 -> 0 bytes 2 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 project/__pycache__/settings.cpython-310.pyc delete mode 100644 project/__pycache__/urls.cpython-310.pyc diff --git a/project/__pycache__/settings.cpython-310.pyc b/project/__pycache__/settings.cpython-310.pyc deleted file mode 100644 index bc3cbdc4534a542957d5940280539149b82f7553..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 906 zcmYjPOK;Oa5cVsH^X!WrKpZ$B1t}?y_JR4id7`b^={oHPHen(tL6wC zkhpT}fgbq*a6rIsNUwY4#1G(tgvusOmF~!+*>Ap`9e=Yyv6$o7dVl-t;f~00zh;}8 zOJ?7}(Lmc9L4su99B9c%FrBMdSD0`Of^N>e5kB0)vLlG6Ago-eQN(@P3ZjkvT z-|$(SJLhKx^Jry`7jPb}o(mq23TW+2WT%R(MhUIM6|@0YS-ggB!F9x&TzT_1>x9#2 z2H`^|@#D#TG;qdVP(=sT1IHcWF(TD4Ah8!=^4hmUa_R=5_jt1D9$|MF2K{kdMfiB+ zjH^N9L1}0E$u`U_lQiWePK018ApOx!IZe|*Ycw@LrI)&CQK_RF%xg-UAzc#~RPHFI zxvv{4%poUsTs)3(1ak)Hw3HgK+rXL>!YCMEH?Ag;PbmLjvbAVB#-q@8V!Uj9kx=J9 zWi8T#X0Mr~EYi%bQriQX3MI8^m{e9e9eWl{Qc+Tgl1ULHQ4r#-c0kz7IcHVvA! zK$}TrvCCy9sNH(>P@~0`qBXio1K2fP1&q^d0~_jW4Cxuif^=O4b*0;~Y^7`IcD)H& z>Sr#x#~#Pr{c%}Td)n&~9Fg8I@tt8$A7eG@ALHKiW{q&iG#@T@HMGNa2zw7J+xCQKVzaMK7P)#3&}QfGAD=vzclHu bbeYae!pzdbT~QEAEGzw!E~V@hDhvMsM}!$8 diff --git a/project/__pycache__/urls.cpython-310.pyc b/project/__pycache__/urls.cpython-310.pyc deleted file mode 100644 index f26ff5d0da4d8e645477532bbb230b3c3f9a1637..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 621 zcmZuvze~eF6uxVcCjA9P5p*aBP90kJQi`Cn4&rhI!jZeSX_H*JOImc)MG!at3I6~c zMEx7mwX2hZqod$U+Cp1;A&>8U@5}q%L8qqSW`FdawBg49%4@_cW#7$;!%<{~9)Bs!DVAcW`xW`JdC((Zdzrt$QY$vJ*noyT(Tt_9q>(WIVaG5Z?$8i2XiRA2_PwyzSPZok*{OYV bbUm}$fnc%EJ8+GVszNBEGR__?jn>~kYeL5O From ee3fa45b07f67cffd36f825ac9806317874ff8fa Mon Sep 17 00:00:00 2001 From: Zney4 <134953901+Zney4@users.noreply.github.com> Date: Wed, 4 Sep 2024 18:12:30 +0300 Subject: [PATCH 04/37] Delete datacenter/migrations/__pycache__ directory --- .../__pycache__/__init__.cpython-310.pyc | Bin 209 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 datacenter/migrations/__pycache__/__init__.cpython-310.pyc diff --git a/datacenter/migrations/__pycache__/__init__.cpython-310.pyc b/datacenter/migrations/__pycache__/__init__.cpython-310.pyc deleted file mode 100644 index bf3e372963fa229ab09567e3da8f0b7947196779..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 209 zcmd1j<>g`kf{M0TX(0MBh(HF6K#l_t7qb9~6oz01O-8?!3`HPe1o5>H$aS`g2`x@7 zDvrr6%}LCT@y| Date: Wed, 4 Sep 2024 18:14:35 +0300 Subject: [PATCH 05/37] Create .gitignore --- .gitignore | 154 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 154 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..e96a3ea8d --- /dev/null +++ b/.gitignore @@ -0,0 +1,154 @@ +.gitattributes +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +.idea +lib64/ +parts/ +sdist/ +var/ +wheels/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ +cover/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 +db.sqlite3-journal + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +.pybuilder/ +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +# For a library or package, you might want to ignore these files since the code is +# intended to run in multiple environments; otherwise, check them in: +# .python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock + +# poetry +# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. +# This is especially recommended for binary packages to ensure reproducibility, and is more +# commonly ignored for libraries. +# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control +#poetry.lock + +# pdm +# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. +#pdm.lock +# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it +# in version control. +# https://pdm.fming.dev/#use-with-ide +.pdm.toml + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm +__pypackages__/ + +# Celery stuff +celerybeat-schedule +celerybeat.pid + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ + +# pytype static type analyzer +.pytype/ + +# Cython debug symbols +cython_debug/ From a897dfdf0e4d805e668b741a2d7a8c8150db781d Mon Sep 17 00:00:00 2001 From: Zney4 <134953901+Zney4@users.noreply.github.com> Date: Wed, 4 Sep 2024 18:15:10 +0300 Subject: [PATCH 06/37] Delete .replit --- .replit | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 .replit diff --git a/.replit b/.replit deleted file mode 100644 index 736d79c1f..000000000 --- a/.replit +++ /dev/null @@ -1,2 +0,0 @@ -language = "python3" -run = "python3 main.py" From 6de0bca519497438affc7204e40e282a9a4058ca Mon Sep 17 00:00:00 2001 From: Zney4 <134953901+Zney4@users.noreply.github.com> Date: Wed, 4 Sep 2024 18:15:39 +0300 Subject: [PATCH 07/37] Delete .idea directory --- .idea/.gitignore | 3 --- .idea/django-orm-watching-storage.iml | 14 -------------- .idea/inspectionProfiles/Project_Default.xml | 12 ------------ .idea/inspectionProfiles/profiles_settings.xml | 6 ------ .idea/misc.xml | 7 ------- .idea/modules.xml | 8 -------- .idea/vcs.xml | 6 ------ 7 files changed, 56 deletions(-) delete mode 100644 .idea/.gitignore delete mode 100644 .idea/django-orm-watching-storage.iml delete mode 100644 .idea/inspectionProfiles/Project_Default.xml delete mode 100644 .idea/inspectionProfiles/profiles_settings.xml delete mode 100644 .idea/misc.xml delete mode 100644 .idea/modules.xml delete mode 100644 .idea/vcs.xml diff --git a/.idea/.gitignore b/.idea/.gitignore deleted file mode 100644 index 26d33521a..000000000 --- a/.idea/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml diff --git a/.idea/django-orm-watching-storage.iml b/.idea/django-orm-watching-storage.iml deleted file mode 100644 index 8e5446ac9..000000000 --- a/.idea/django-orm-watching-storage.iml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml deleted file mode 100644 index 4aae69f49..000000000 --- a/.idea/inspectionProfiles/Project_Default.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml deleted file mode 100644 index 105ce2da2..000000000 --- a/.idea/inspectionProfiles/profiles_settings.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index fccf8de16..000000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index d506e018c..000000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 35eb1ddfb..000000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file From bf86646fd338cd060a0b8bc1998be3c20426b9b8 Mon Sep 17 00:00:00 2001 From: Zney4 <134953901+Zney4@users.noreply.github.com> Date: Wed, 4 Sep 2024 18:15:56 +0300 Subject: [PATCH 08/37] Delete poetry.lock --- poetry.lock | 132 ---------------------------------------------------- 1 file changed, 132 deletions(-) delete mode 100644 poetry.lock diff --git a/poetry.lock b/poetry.lock deleted file mode 100644 index 35b05c94d..000000000 --- a/poetry.lock +++ /dev/null @@ -1,132 +0,0 @@ -[[package]] -name = "asgiref" -version = "3.5.0" -description = "ASGI specs, helper code, and adapters" -category = "main" -optional = false -python-versions = ">=3.7" - -[package.extras] -tests = ["pytest", "pytest-asyncio", "mypy (>=0.800)"] - -[[package]] -name = "django" -version = "3.2.12" -description = "A high-level Python Web framework that encourages rapid development and clean, pragmatic design." -category = "main" -optional = false -python-versions = ">=3.6" - -[package.dependencies] -asgiref = ">=3.3.2,<4" -pytz = "*" -sqlparse = ">=0.2.2" - -[package.extras] -argon2 = ["argon2-cffi (>=19.1.0)"] -bcrypt = ["bcrypt"] - -[[package]] -name = "psycopg2-binary" -version = "2.9.3" -description = "psycopg2 - Python-PostgreSQL Database Adapter" -category = "main" -optional = false -python-versions = ">=3.6" - -[[package]] -name = "pytz" -version = "2021.3" -description = "World timezone definitions, modern and historical" -category = "main" -optional = false -python-versions = "*" - -[[package]] -name = "sqlparse" -version = "0.4.2" -description = "A non-validating SQL parser." -category = "main" -optional = false -python-versions = ">=3.5" - -[metadata] -lock-version = "1.1" -python-versions = "^3.8" -content-hash = "5773c4b77c00ab8a09385b61e8b27f4f28cbdee2dcba76a83b13ee24d0e6759a" - -[metadata.files] -asgiref = [ - {file = "asgiref-3.5.0-py3-none-any.whl", hash = "sha256:88d59c13d634dcffe0510be048210188edd79aeccb6a6c9028cdad6f31d730a9"}, - {file = "asgiref-3.5.0.tar.gz", hash = "sha256:2f8abc20f7248433085eda803936d98992f1343ddb022065779f37c5da0181d0"}, -] -django = [ - {file = "Django-3.2.12-py3-none-any.whl", hash = "sha256:9b06c289f9ba3a8abea16c9c9505f25107809fb933676f6c891ded270039d965"}, - {file = "Django-3.2.12.tar.gz", hash = "sha256:9772e6935703e59e993960832d66a614cf0233a1c5123bc6224ecc6ad69e41e2"}, -] -psycopg2-binary = [ - {file = "psycopg2-binary-2.9.3.tar.gz", hash = "sha256:761df5313dc15da1502b21453642d7599d26be88bff659382f8f9747c7ebea4e"}, - {file = "psycopg2_binary-2.9.3-cp310-cp310-macosx_10_14_x86_64.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl", hash = "sha256:539b28661b71da7c0e428692438efbcd048ca21ea81af618d845e06ebfd29478"}, - {file = "psycopg2_binary-2.9.3-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6e82d38390a03da28c7985b394ec3f56873174e2c88130e6966cb1c946508e65"}, - {file = "psycopg2_binary-2.9.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:57804fc02ca3ce0dbfbef35c4b3a4a774da66d66ea20f4bda601294ad2ea6092"}, - {file = "psycopg2_binary-2.9.3-cp310-cp310-manylinux_2_24_aarch64.whl", hash = "sha256:083a55275f09a62b8ca4902dd11f4b33075b743cf0d360419e2051a8a5d5ff76"}, - {file = "psycopg2_binary-2.9.3-cp310-cp310-manylinux_2_24_ppc64le.whl", hash = "sha256:0a29729145aaaf1ad8bafe663131890e2111f13416b60e460dae0a96af5905c9"}, - {file = "psycopg2_binary-2.9.3-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:3a79d622f5206d695d7824cbf609a4f5b88ea6d6dab5f7c147fc6d333a8787e4"}, - {file = "psycopg2_binary-2.9.3-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:090f3348c0ab2cceb6dfbe6bf721ef61262ddf518cd6cc6ecc7d334996d64efa"}, - {file = "psycopg2_binary-2.9.3-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:a9e1f75f96ea388fbcef36c70640c4efbe4650658f3d6a2967b4cc70e907352e"}, - {file = "psycopg2_binary-2.9.3-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:c3ae8e75eb7160851e59adc77b3a19a976e50622e44fd4fd47b8b18208189d42"}, - {file = "psycopg2_binary-2.9.3-cp310-cp310-win32.whl", hash = "sha256:7b1e9b80afca7b7a386ef087db614faebbf8839b7f4db5eb107d0f1a53225029"}, - {file = "psycopg2_binary-2.9.3-cp310-cp310-win_amd64.whl", hash = "sha256:8b344adbb9a862de0c635f4f0425b7958bf5a4b927c8594e6e8d261775796d53"}, - {file = "psycopg2_binary-2.9.3-cp36-cp36m-macosx_10_14_x86_64.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl", hash = "sha256:e847774f8ffd5b398a75bc1c18fbb56564cda3d629fe68fd81971fece2d3c67e"}, - {file = "psycopg2_binary-2.9.3-cp36-cp36m-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:68641a34023d306be959101b345732360fc2ea4938982309b786f7be1b43a4a1"}, - {file = "psycopg2_binary-2.9.3-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3303f8807f342641851578ee7ed1f3efc9802d00a6f83c101d21c608cb864460"}, - {file = "psycopg2_binary-2.9.3-cp36-cp36m-manylinux_2_24_aarch64.whl", hash = "sha256:e3699852e22aa68c10de06524a3721ade969abf382da95884e6a10ff798f9281"}, - {file = "psycopg2_binary-2.9.3-cp36-cp36m-manylinux_2_24_ppc64le.whl", hash = "sha256:526ea0378246d9b080148f2d6681229f4b5964543c170dd10bf4faaab6e0d27f"}, - {file = "psycopg2_binary-2.9.3-cp36-cp36m-musllinux_1_1_aarch64.whl", hash = "sha256:b1c8068513f5b158cf7e29c43a77eb34b407db29aca749d3eb9293ee0d3103ca"}, - {file = "psycopg2_binary-2.9.3-cp36-cp36m-musllinux_1_1_i686.whl", hash = "sha256:15803fa813ea05bef089fa78835118b5434204f3a17cb9f1e5dbfd0b9deea5af"}, - {file = "psycopg2_binary-2.9.3-cp36-cp36m-musllinux_1_1_ppc64le.whl", hash = "sha256:152f09f57417b831418304c7f30d727dc83a12761627bb826951692cc6491e57"}, - {file = "psycopg2_binary-2.9.3-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:404224e5fef3b193f892abdbf8961ce20e0b6642886cfe1fe1923f41aaa75c9d"}, - {file = "psycopg2_binary-2.9.3-cp36-cp36m-win32.whl", hash = "sha256:1f6b813106a3abdf7b03640d36e24669234120c72e91d5cbaeb87c5f7c36c65b"}, - {file = "psycopg2_binary-2.9.3-cp36-cp36m-win_amd64.whl", hash = "sha256:2d872e3c9d5d075a2e104540965a1cf898b52274a5923936e5bfddb58c59c7c2"}, - {file = "psycopg2_binary-2.9.3-cp37-cp37m-macosx_10_14_x86_64.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl", hash = "sha256:10bb90fb4d523a2aa67773d4ff2b833ec00857f5912bafcfd5f5414e45280fb1"}, - {file = "psycopg2_binary-2.9.3-cp37-cp37m-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:874a52ecab70af13e899f7847b3e074eeb16ebac5615665db33bce8a1009cf33"}, - {file = "psycopg2_binary-2.9.3-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a29b3ca4ec9defec6d42bf5feb36bb5817ba3c0230dd83b4edf4bf02684cd0ae"}, - {file = "psycopg2_binary-2.9.3-cp37-cp37m-manylinux_2_24_aarch64.whl", hash = "sha256:12b11322ea00ad8db8c46f18b7dfc47ae215e4df55b46c67a94b4effbaec7094"}, - {file = "psycopg2_binary-2.9.3-cp37-cp37m-manylinux_2_24_ppc64le.whl", hash = "sha256:53293533fcbb94c202b7c800a12c873cfe24599656b341f56e71dd2b557be063"}, - {file = "psycopg2_binary-2.9.3-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:c381bda330ddf2fccbafab789d83ebc6c53db126e4383e73794c74eedce855ef"}, - {file = "psycopg2_binary-2.9.3-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:9d29409b625a143649d03d0fd7b57e4b92e0ecad9726ba682244b73be91d2fdb"}, - {file = "psycopg2_binary-2.9.3-cp37-cp37m-musllinux_1_1_ppc64le.whl", hash = "sha256:183a517a3a63503f70f808b58bfbf962f23d73b6dccddae5aa56152ef2bcb232"}, - {file = "psycopg2_binary-2.9.3-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:15c4e4cfa45f5a60599d9cec5f46cd7b1b29d86a6390ec23e8eebaae84e64554"}, - {file = "psycopg2_binary-2.9.3-cp37-cp37m-win32.whl", hash = "sha256:adf20d9a67e0b6393eac162eb81fb10bc9130a80540f4df7e7355c2dd4af9fba"}, - {file = "psycopg2_binary-2.9.3-cp37-cp37m-win_amd64.whl", hash = "sha256:2f9ffd643bc7349eeb664eba8864d9e01f057880f510e4681ba40a6532f93c71"}, - {file = "psycopg2_binary-2.9.3-cp38-cp38-macosx_10_14_x86_64.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl", hash = "sha256:def68d7c21984b0f8218e8a15d514f714d96904265164f75f8d3a70f9c295667"}, - {file = "psycopg2_binary-2.9.3-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:dffc08ca91c9ac09008870c9eb77b00a46b3378719584059c034b8945e26b272"}, - {file = "psycopg2_binary-2.9.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:280b0bb5cbfe8039205c7981cceb006156a675362a00fe29b16fbc264e242834"}, - {file = "psycopg2_binary-2.9.3-cp38-cp38-manylinux_2_24_aarch64.whl", hash = "sha256:af9813db73395fb1fc211bac696faea4ca9ef53f32dc0cfa27e4e7cf766dcf24"}, - {file = "psycopg2_binary-2.9.3-cp38-cp38-manylinux_2_24_ppc64le.whl", hash = "sha256:63638d875be8c2784cfc952c9ac34e2b50e43f9f0a0660b65e2a87d656b3116c"}, - {file = "psycopg2_binary-2.9.3-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:ffb7a888a047696e7f8240d649b43fb3644f14f0ee229077e7f6b9f9081635bd"}, - {file = "psycopg2_binary-2.9.3-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:0c9d5450c566c80c396b7402895c4369a410cab5a82707b11aee1e624da7d004"}, - {file = "psycopg2_binary-2.9.3-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:d1c1b569ecafe3a69380a94e6ae09a4789bbb23666f3d3a08d06bbd2451f5ef1"}, - {file = "psycopg2_binary-2.9.3-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:8fc53f9af09426a61db9ba357865c77f26076d48669f2e1bb24d85a22fb52307"}, - {file = "psycopg2_binary-2.9.3-cp38-cp38-win32.whl", hash = "sha256:6472a178e291b59e7f16ab49ec8b4f3bdada0a879c68d3817ff0963e722a82ce"}, - {file = "psycopg2_binary-2.9.3-cp38-cp38-win_amd64.whl", hash = "sha256:35168209c9d51b145e459e05c31a9eaeffa9a6b0fd61689b48e07464ffd1a83e"}, - {file = "psycopg2_binary-2.9.3-cp39-cp39-macosx_10_14_x86_64.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl", hash = "sha256:47133f3f872faf28c1e87d4357220e809dfd3fa7c64295a4a148bcd1e6e34ec9"}, - {file = "psycopg2_binary-2.9.3-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:91920527dea30175cc02a1099f331aa8c1ba39bf8b7762b7b56cbf54bc5cce42"}, - {file = "psycopg2_binary-2.9.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:887dd9aac71765ac0d0bac1d0d4b4f2c99d5f5c1382d8b770404f0f3d0ce8a39"}, - {file = "psycopg2_binary-2.9.3-cp39-cp39-manylinux_2_24_aarch64.whl", hash = "sha256:1f14c8b0942714eb3c74e1e71700cbbcb415acbc311c730370e70c578a44a25c"}, - {file = "psycopg2_binary-2.9.3-cp39-cp39-manylinux_2_24_ppc64le.whl", hash = "sha256:7af0dd86ddb2f8af5da57a976d27cd2cd15510518d582b478fbb2292428710b4"}, - {file = "psycopg2_binary-2.9.3-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:93cd1967a18aa0edd4b95b1dfd554cf15af657cb606280996d393dadc88c3c35"}, - {file = "psycopg2_binary-2.9.3-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:bda845b664bb6c91446ca9609fc69f7db6c334ec5e4adc87571c34e4f47b7ddb"}, - {file = "psycopg2_binary-2.9.3-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:01310cf4cf26db9aea5158c217caa92d291f0500051a6469ac52166e1a16f5b7"}, - {file = "psycopg2_binary-2.9.3-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:99485cab9ba0fa9b84f1f9e1fef106f44a46ef6afdeec8885e0b88d0772b49e8"}, - {file = "psycopg2_binary-2.9.3-cp39-cp39-win32.whl", hash = "sha256:46f0e0a6b5fa5851bbd9ab1bc805eef362d3a230fbdfbc209f4a236d0a7a990d"}, - {file = "psycopg2_binary-2.9.3-cp39-cp39-win_amd64.whl", hash = "sha256:accfe7e982411da3178ec690baaceaad3c278652998b2c45828aaac66cd8285f"}, -] -pytz = [ - {file = "pytz-2021.3-py2.py3-none-any.whl", hash = "sha256:3672058bc3453457b622aab7a1c3bfd5ab0bdae451512f6cf25f64ed37f5b87c"}, - {file = "pytz-2021.3.tar.gz", hash = "sha256:acad2d8b20a1af07d4e4c9d2e9285c5ed9104354062f275f3fcd88dcef4f1326"}, -] -sqlparse = [ - {file = "sqlparse-0.4.2-py3-none-any.whl", hash = "sha256:48719e356bb8b42991bdbb1e8b83223757b93789c00910a616a071910ca4a64d"}, - {file = "sqlparse-0.4.2.tar.gz", hash = "sha256:0c00730c74263a94e5a9919ade150dfc3b19c574389985446148402998287dae"}, -] From c0144f88f685b3e2a64ee0a31d41df6d77852f10 Mon Sep 17 00:00:00 2001 From: Zney4 <134953901+Zney4@users.noreply.github.com> Date: Wed, 4 Sep 2024 18:16:15 +0300 Subject: [PATCH 09/37] Delete pyproject.toml --- pyproject.toml | 15 --------------- 1 file changed, 15 deletions(-) delete mode 100644 pyproject.toml diff --git a/pyproject.toml b/pyproject.toml deleted file mode 100644 index 93143cfea..000000000 --- a/pyproject.toml +++ /dev/null @@ -1,15 +0,0 @@ -[build-system] -build-backend = "poetry.masonry.api" -requires = ["poetry>=0.12"] - -[tool] -[tool.poetry] -authors = ["Ilya Osipov <070809010@mail.ru>"] -description = "" -name = "django-orm-standalone-5" -version = "0.1.0" -[tool.poetry.dependencies] -django = "~3.2" -psycopg2-binary = "~2.9" -python = "^3.8" -[tool.poetry.dev-dependencies] From c68174e544fe86d38dabdbc75e97b26fafcea1f0 Mon Sep 17 00:00:00 2001 From: Zney4 <134953901+Zney4@users.noreply.github.com> Date: Wed, 4 Sep 2024 18:18:35 +0300 Subject: [PATCH 10/37] Delete text --- datacenter/active_passcards_view.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datacenter/active_passcards_view.py b/datacenter/active_passcards_view.py index 2649e3381..ea2fa1ff9 100644 --- a/datacenter/active_passcards_view.py +++ b/datacenter/active_passcards_view.py @@ -7,6 +7,6 @@ def active_passcards_view(request): active_passcards = Passcard.objects.filter(is_active=True) context = { - "active_passcards": active_passcards, # люди с активными пропусками + "active_passcards": active_passcards, } return render(request, "active_passcards.html", context) From 8c68953482d80d8cdcae0a29068f1bbec68622fb Mon Sep 17 00:00:00 2001 From: Zney4 <134953901+Zney4@users.noreply.github.com> Date: Mon, 9 Sep 2024 17:17:49 +0300 Subject: [PATCH 11/37] fix --- datacenter/models.py | 8 +------- datacenter/storage_information_view.py | 1 - 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/datacenter/models.py b/datacenter/models.py index e3c442270..e4942ce7d 100644 --- a/datacenter/models.py +++ b/datacenter/models.py @@ -48,10 +48,4 @@ def format_duration(self, visit_time): def is_visit_long(self): minutes = 60 duration = self.get_duration() - return duration // 60 > minutes - - def is_visit_long_now(self): - now = datetime.datetime.now(timezone.utc) - minutes = 60 - duration = (now - localtime(self.entered_at)).total_seconds() - return duration // 60 > minutes + return duration // 60 > minutes \ No newline at end of file diff --git a/datacenter/storage_information_view.py b/datacenter/storage_information_view.py index 161932bb7..2f4bd7fef 100644 --- a/datacenter/storage_information_view.py +++ b/datacenter/storage_information_view.py @@ -19,7 +19,6 @@ def storage_information_view(request): "who_entered": visit.passcard.owner_name, "entered_at": entered, "duration": visit.format_duration(now - entered), - "is_strange": visit.is_visit_long_now(), } ) From 0fcee5bc750fd9910163571aafef722f3c7b486d Mon Sep 17 00:00:00 2001 From: Zney4 <134953901+Zney4@users.noreply.github.com> Date: Mon, 9 Sep 2024 17:23:13 +0300 Subject: [PATCH 12/37] fix --- datacenter/models.py | 8 ++++++-- datacenter/storage_information_view.py | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/datacenter/models.py b/datacenter/models.py index e4942ce7d..bf9538654 100644 --- a/datacenter/models.py +++ b/datacenter/models.py @@ -46,6 +46,10 @@ def format_duration(self, visit_time): return f"{int(hours)}ч {int(minutes)}мин" def is_visit_long(self): + now = datetime.datetime.now(timezone.utc) minutes = 60 - duration = self.get_duration() - return duration // 60 > minutes \ No newline at end of file + if self.leaved_at == None: + duration = (now - localtime(self.entered_at)).total_seconds() + else: + duration = self.get_duration() + return duration // 60 > minutes diff --git a/datacenter/storage_information_view.py b/datacenter/storage_information_view.py index 2f4bd7fef..c065b9d9e 100644 --- a/datacenter/storage_information_view.py +++ b/datacenter/storage_information_view.py @@ -19,6 +19,7 @@ def storage_information_view(request): "who_entered": visit.passcard.owner_name, "entered_at": entered, "duration": visit.format_duration(now - entered), + "is_strange": visit.is_visit_long(), } ) From c1d2f6c5e70ac7f20e6b6715d55a3347cdf1f632 Mon Sep 17 00:00:00 2001 From: Zney4 <134953901+Zney4@users.noreply.github.com> Date: Mon, 9 Sep 2024 17:59:10 +0300 Subject: [PATCH 13/37] fix code --- datacenter/models.py | 14 +++++--------- datacenter/passcard_info_view.py | 2 -- datacenter/storage_information_view.py | 2 +- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/datacenter/models.py b/datacenter/models.py index e3c442270..eede8d0b5 100644 --- a/datacenter/models.py +++ b/datacenter/models.py @@ -39,19 +39,15 @@ def format_duration(self, visit_time): seconds = visit_time.total_seconds() hours = seconds // 3600 - int(hours) - minutes = (seconds % 3600) // 60 - int(minutes) + return f"{int(hours)}ч {int(minutes)}мин" def is_visit_long(self): - minutes = 60 - duration = self.get_duration() - return duration // 60 > minutes - - def is_visit_long_now(self): now = datetime.datetime.now(timezone.utc) minutes = 60 - duration = (now - localtime(self.entered_at)).total_seconds() + if self.entered_at == None: + duration = (now - localtime(self.entered_at)).total_seconds() + else: + duration = self.get_duration() return duration // 60 > minutes diff --git a/datacenter/passcard_info_view.py b/datacenter/passcard_info_view.py index 6cc6981a9..5d54c3f10 100644 --- a/datacenter/passcard_info_view.py +++ b/datacenter/passcard_info_view.py @@ -2,8 +2,6 @@ from datacenter.models import Visit from django.shortcuts import render, get_object_or_404 from django.utils.timezone import localtime -from datetime import timezone -import datetime def passcard_info_view(request, passcode): diff --git a/datacenter/storage_information_view.py b/datacenter/storage_information_view.py index 161932bb7..c065b9d9e 100644 --- a/datacenter/storage_information_view.py +++ b/datacenter/storage_information_view.py @@ -19,7 +19,7 @@ def storage_information_view(request): "who_entered": visit.passcard.owner_name, "entered_at": entered, "duration": visit.format_duration(now - entered), - "is_strange": visit.is_visit_long_now(), + "is_strange": visit.is_visit_long(), } ) From d53626ec047eb1d7afac7fcaaff9ff85a2ce314a Mon Sep 17 00:00:00 2001 From: Zney4 <134953901+Zney4@users.noreply.github.com> Date: Mon, 9 Sep 2024 17:59:58 +0300 Subject: [PATCH 14/37] fix code --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 55460f2cc..fe3bdef13 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,2 @@ django==3.2.* -psycopg2-binary==2.9.* +psycopg2-binary==2.9.* \ No newline at end of file From e7a4308c5a83702de72984c1cc62e876ce933e53 Mon Sep 17 00:00:00 2001 From: Zney4 <134953901+Zney4@users.noreply.github.com> Date: Mon, 9 Sep 2024 18:25:27 +0300 Subject: [PATCH 15/37] Create README.md --- README.md | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 000000000..0b7124dd5 --- /dev/null +++ b/README.md @@ -0,0 +1,45 @@ +# База данных хранилищя или пульт управления для охранника + +## Короткое описание проекта + +Пульт управления для охранника, чтобы он мог следить за всеми, кто находится в хранилище. + + +## Требования к окружению +Python + +Python3 должен быть уже установлен, +затем используйте `pip` (или `pip3`, есть конфликт с Python2) для установки зависимостей. +```python +pip install -r requirements.txt +``` + + + + +## Примеры запуска кода + +Открываем браузер и заходим на локальный сайт: +``` +http://localhost:8000 +``` + + + +#### Для запуска сайта +``` +python main +``` + +### Пример результата + +Открываем браузер и заходим на локальный сайт: +``` +http://localhost:8000 +``` + + +### Цель проекта +Cделать пульт управления для охранника, чтобы он мог следить за всеми, кто находится в хранилище. + +Код написан в образовательных целях.. From e05174e00d3bdcfdf51749be7bc45145faf26695 Mon Sep 17 00:00:00 2001 From: Zney4 <134953901+Zney4@users.noreply.github.com> Date: Mon, 9 Sep 2024 18:38:02 +0300 Subject: [PATCH 16/37] Update README.md --- README.md | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/README.md b/README.md index 0b7124dd5..fb7295ac3 100644 --- a/README.md +++ b/README.md @@ -15,17 +15,6 @@ pip install -r requirements.txt ``` - - -## Примеры запуска кода - -Открываем браузер и заходим на локальный сайт: -``` -http://localhost:8000 -``` - - - #### Для запуска сайта ``` python main From e252b4d374804b217982dbfd2eea29abd323406b Mon Sep 17 00:00:00 2001 From: Zney4 <134953901+Zney4@users.noreply.github.com> Date: Mon, 23 Sep 2024 18:44:04 +0300 Subject: [PATCH 17/37] Update README.md --- README.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index fb7295ac3..d6599c951 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,17 @@ Python3 должен быть уже установлен, ```python pip install -r requirements.txt ``` - +## Переменные окружения +Файл .env +В нём надо указать данные для файла `settings.py`. +``` +ENGINE=example +HOST=example +PORT=example +NAME=example +USER=example +PASSWORD=example +``` #### Для запуска сайта ``` From 3bb3fe03d9bc1b3943a35cb2e0098d6a7f0f0ea9 Mon Sep 17 00:00:00 2001 From: Zney4 <134953901+Zney4@users.noreply.github.com> Date: Mon, 23 Sep 2024 18:53:47 +0300 Subject: [PATCH 18/37] fix code --- project/settings.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/project/settings.py b/project/settings.py index 24c16811e..8671917d2 100644 --- a/project/settings.py +++ b/project/settings.py @@ -1,13 +1,15 @@ import os +from dotenv import load_dotenv +load_dotenv() DATABASES = { "default": { - "ENGINE": "django.db.backends.postgresql_psycopg2", - "HOST": "checkpoint.devman.org", - "PORT": "5434", - "NAME": "checkpoint", - "USER": "guard", - "PASSWORD": "osim5", + "ENGINE": os.environ["ENGINE"], + "HOST": os.environ["HOST"], + "PORT": os.environ["PORT"], + "NAME": os.environ["NAME"], + "USER": os.environ["USER"], + "PASSWORD": os.environ["PASSWORD"], } } From eb02941d2ba0a0101e066f0901e85fded34085cf Mon Sep 17 00:00:00 2001 From: Zney4 <134953901+Zney4@users.noreply.github.com> Date: Fri, 27 Sep 2024 18:23:50 +0300 Subject: [PATCH 19/37] Create README.md --- README.md | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 000000000..d6599c951 --- /dev/null +++ b/README.md @@ -0,0 +1,44 @@ +# База данных хранилищя или пульт управления для охранника + +## Короткое описание проекта + +Пульт управления для охранника, чтобы он мог следить за всеми, кто находится в хранилище. + + +## Требования к окружению +Python + +Python3 должен быть уже установлен, +затем используйте `pip` (или `pip3`, есть конфликт с Python2) для установки зависимостей. +```python +pip install -r requirements.txt +``` +## Переменные окружения +Файл .env +В нём надо указать данные для файла `settings.py`. +``` +ENGINE=example +HOST=example +PORT=example +NAME=example +USER=example +PASSWORD=example +``` + +#### Для запуска сайта +``` +python main +``` + +### Пример результата + +Открываем браузер и заходим на локальный сайт: +``` +http://localhost:8000 +``` + + +### Цель проекта +Cделать пульт управления для охранника, чтобы он мог следить за всеми, кто находится в хранилище. + +Код написан в образовательных целях.. From 7dc9eeeedaed50bba5c7740d7fc7fc38a77b49a7 Mon Sep 17 00:00:00 2001 From: Zney4 <134953901+Zney4@users.noreply.github.com> Date: Fri, 27 Sep 2024 18:23:52 +0300 Subject: [PATCH 20/37] Update passcard_info_view.py --- datacenter/passcard_info_view.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/datacenter/passcard_info_view.py b/datacenter/passcard_info_view.py index 6cc6981a9..5d54c3f10 100644 --- a/datacenter/passcard_info_view.py +++ b/datacenter/passcard_info_view.py @@ -2,8 +2,6 @@ from datacenter.models import Visit from django.shortcuts import render, get_object_or_404 from django.utils.timezone import localtime -from datetime import timezone -import datetime def passcard_info_view(request, passcode): From 23d45b91492993f62378ae0a3cfd41ab129c5bba Mon Sep 17 00:00:00 2001 From: Zney4 <134953901+Zney4@users.noreply.github.com> Date: Fri, 27 Sep 2024 18:23:56 +0300 Subject: [PATCH 21/37] Update models.py --- datacenter/models.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/datacenter/models.py b/datacenter/models.py index bf9538654..352bea163 100644 --- a/datacenter/models.py +++ b/datacenter/models.py @@ -39,16 +39,18 @@ def format_duration(self, visit_time): seconds = visit_time.total_seconds() hours = seconds // 3600 - int(hours) - minutes = (seconds % 3600) // 60 - int(minutes) + return f"{int(hours)}ч {int(minutes)}мин" def is_visit_long(self): now = datetime.datetime.now(timezone.utc) minutes = 60 +<<<<<<< HEAD if self.leaved_at == None: +======= + if self.entered_at == None: +>>>>>>> e252b4d374804b217982dbfd2eea29abd323406b duration = (now - localtime(self.entered_at)).total_seconds() else: duration = self.get_duration() From 050fc501680ffb5ed8902f479516e0cc0de690bf Mon Sep 17 00:00:00 2001 From: Zney4 <134953901+Zney4@users.noreply.github.com> Date: Fri, 27 Sep 2024 18:51:45 +0300 Subject: [PATCH 22/37] fix code --- project/settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/settings.py b/project/settings.py index 8671917d2..20c38aedd 100644 --- a/project/settings.py +++ b/project/settings.py @@ -15,7 +15,7 @@ INSTALLED_APPS = ["datacenter"] -SECRET_KEY = "REPLACE_ME" +SECRET_KEY = os.environ["SECRET_KEY"] DEBUG = True From 14f707cec934434c0940e17bc6fd91054e7a14c6 Mon Sep 17 00:00:00 2001 From: Zney4 <134953901+Zney4@users.noreply.github.com> Date: Wed, 2 Oct 2024 18:18:12 +0300 Subject: [PATCH 23/37] fix code --- datacenter/models.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/datacenter/models.py b/datacenter/models.py index 352bea163..1e55ebf04 100644 --- a/datacenter/models.py +++ b/datacenter/models.py @@ -46,11 +46,11 @@ def format_duration(self, visit_time): def is_visit_long(self): now = datetime.datetime.now(timezone.utc) minutes = 60 -<<<<<<< HEAD + if self.leaved_at == None: -======= + duration = (localtime(self.leaved_at) - localtime(self.entered_at)).total_seconds() + if self.entered_at == None: ->>>>>>> e252b4d374804b217982dbfd2eea29abd323406b duration = (now - localtime(self.entered_at)).total_seconds() else: duration = self.get_duration() From 2823e1c2e85dc2037092fb0339b900478e640d4c Mon Sep 17 00:00:00 2001 From: Zney4 <134953901+Zney4@users.noreply.github.com> Date: Wed, 2 Oct 2024 18:18:40 +0300 Subject: [PATCH 24/37] fix code --- datacenter/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datacenter/models.py b/datacenter/models.py index 1e55ebf04..15cfdffe2 100644 --- a/datacenter/models.py +++ b/datacenter/models.py @@ -48,7 +48,7 @@ def is_visit_long(self): minutes = 60 if self.leaved_at == None: - duration = (localtime(self.leaved_at) - localtime(self.entered_at)).total_seconds() + localtime(self.leaved_at) - localtime(self.entered_at).total_seconds() if self.entered_at == None: duration = (now - localtime(self.entered_at)).total_seconds() From 2d7f08e575e15d24b3ea5b7513567cd3f775a1b2 Mon Sep 17 00:00:00 2001 From: Zney4 <134953901+Zney4@users.noreply.github.com> Date: Wed, 2 Oct 2024 18:25:29 +0300 Subject: [PATCH 25/37] fix code --- datacenter/models.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/datacenter/models.py b/datacenter/models.py index 15cfdffe2..9554e2450 100644 --- a/datacenter/models.py +++ b/datacenter/models.py @@ -47,10 +47,7 @@ def is_visit_long(self): now = datetime.datetime.now(timezone.utc) minutes = 60 - if self.leaved_at == None: - localtime(self.leaved_at) - localtime(self.entered_at).total_seconds() - - if self.entered_at == None: + if self.leaved_at is None: duration = (now - localtime(self.entered_at)).total_seconds() else: duration = self.get_duration() From 4816ad68b2ff1aba7430e7f25067d9b0f77539bc Mon Sep 17 00:00:00 2001 From: Zney4 <134953901+Zney4@users.noreply.github.com> Date: Wed, 2 Oct 2024 18:55:45 +0300 Subject: [PATCH 26/37] fix code --- project/settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/settings.py b/project/settings.py index 20c38aedd..437d55147 100644 --- a/project/settings.py +++ b/project/settings.py @@ -21,7 +21,7 @@ ROOT_URLCONF = "project.urls" -ALLOWED_HOSTS = ["*"] +ALLOWED_HOSTS = os.environ['ALLOWED_HOSTS'] BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) From 3e1b76227eb075408336cfff1dae0237b5df19e4 Mon Sep 17 00:00:00 2001 From: Zney4 <134953901+Zney4@users.noreply.github.com> Date: Wed, 2 Oct 2024 18:56:13 +0300 Subject: [PATCH 27/37] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index d6599c951..4744efe3b 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,7 @@ PORT=example NAME=example USER=example PASSWORD=example +ALLOWED_HOSTS=example ``` #### Для запуска сайта From b2d9f413d4b6dd3031bfa12322ed4f5321afeb7c Mon Sep 17 00:00:00 2001 From: Zney4 <134953901+Zney4@users.noreply.github.com> Date: Mon, 7 Oct 2024 17:07:56 +0300 Subject: [PATCH 28/37] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 4744efe3b..eb984517a 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,7 @@ PORT=example NAME=example USER=example PASSWORD=example +DEBUG=example ALLOWED_HOSTS=example ``` From e2c0fa54591be596a8ce54ada85d710910f4a66c Mon Sep 17 00:00:00 2001 From: Zney4 <134953901+Zney4@users.noreply.github.com> Date: Mon, 7 Oct 2024 17:09:31 +0300 Subject: [PATCH 29/37] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index eb984517a..086655d6f 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# База данных хранилищя или пульт управления для охранника +# База данных хранилища или пульт управления для охранника ## Короткое описание проекта From efa71d43e606d19c8534a57d7fba22f788219016 Mon Sep 17 00:00:00 2001 From: Zney4 <134953901+Zney4@users.noreply.github.com> Date: Wed, 9 Oct 2024 18:38:00 +0300 Subject: [PATCH 30/37] fix code --- project/settings.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/project/settings.py b/project/settings.py index 437d55147..979f755c3 100644 --- a/project/settings.py +++ b/project/settings.py @@ -4,24 +4,24 @@ load_dotenv() DATABASES = { "default": { - "ENGINE": os.environ["ENGINE"], - "HOST": os.environ["HOST"], - "PORT": os.environ["PORT"], - "NAME": os.environ["NAME"], - "USER": os.environ["USER"], - "PASSWORD": os.environ["PASSWORD"], + "ENGINE": os.environ["DB_ENGINE"], + "HOST": os.environ["DB_HOST"], + "PORT": os.environ["DB_PORT"], + "NAME": os.environ["DB_NAME"], + "USER": os.environ["DB_USER"], + "PASSWORD": os.environ["DB_PASSWORD"], } } INSTALLED_APPS = ["datacenter"] -SECRET_KEY = os.environ["SECRET_KEY"] +SECRET_KEY = os.environ["DB_SECRET_KEY"] -DEBUG = True +DEBUG = os.environ["DB_DEBUG"] ROOT_URLCONF = "project.urls" -ALLOWED_HOSTS = os.environ['ALLOWED_HOSTS'] +ALLOWED_HOSTS = os.environ['DB_ALLOWED_HOSTS'] BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) From 7d95104e9358b5fd1c5904b60eff217206ad52da Mon Sep 17 00:00:00 2001 From: Zney4 <134953901+Zney4@users.noreply.github.com> Date: Wed, 9 Oct 2024 18:53:16 +0300 Subject: [PATCH 31/37] fix code --- requirements.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index fe3bdef13..67f5fdbab 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,3 @@ django==3.2.* -psycopg2-binary==2.9.* \ No newline at end of file +psycopg2-binary==2.9.* +python-dotenv==1.0.1 \ No newline at end of file From 91cff6958a9f822028f33d7293b33e5749cafa28 Mon Sep 17 00:00:00 2001 From: Zney4 <134953901+Zney4@users.noreply.github.com> Date: Wed, 9 Oct 2024 18:55:19 +0300 Subject: [PATCH 32/37] Update README.md --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 086655d6f..fc1ba10ca 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,10 @@ PASSWORD=example DEBUG=example ALLOWED_HOSTS=example ``` - +В файле settings.py есть настройка DEBUG, она включает отладочный режим работы сайта. На локальной машине она обычно равна True, а на сервере — False. +``` +DEBUG=example +``` #### Для запуска сайта ``` python main From f09308f7cde62aa97925616d8534663e07af729c Mon Sep 17 00:00:00 2001 From: Zney4 <134953901+Zney4@users.noreply.github.com> Date: Wed, 9 Oct 2024 18:56:33 +0300 Subject: [PATCH 33/37] Update README.md --- README.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index fc1ba10ca..3abcb6a48 100644 --- a/README.md +++ b/README.md @@ -17,18 +17,18 @@ pip install -r requirements.txt Файл .env В нём надо указать данные для файла `settings.py`. ``` -ENGINE=example -HOST=example -PORT=example -NAME=example -USER=example -PASSWORD=example -DEBUG=example -ALLOWED_HOSTS=example +DB_ENGINE=example +DB_HOST=example +DB_PORT=example +DB_NAME=example +DB_USER=example +DB_PASSWORD=example +DB_DEBUG=example +DB_ALLOWED_HOSTS=example ``` В файле settings.py есть настройка DEBUG, она включает отладочный режим работы сайта. На локальной машине она обычно равна True, а на сервере — False. ``` -DEBUG=example +DB_DEBUG=example ``` #### Для запуска сайта ``` From 86cf79589c3be5b53da22f02838d91a04c8826d7 Mon Sep 17 00:00:00 2001 From: Zney4 <134953901+Zney4@users.noreply.github.com> Date: Mon, 14 Oct 2024 18:12:34 +0300 Subject: [PATCH 34/37] fix code --- project/settings.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/project/settings.py b/project/settings.py index 979f755c3..50311d579 100644 --- a/project/settings.py +++ b/project/settings.py @@ -15,13 +15,13 @@ INSTALLED_APPS = ["datacenter"] -SECRET_KEY = os.environ["DB_SECRET_KEY"] +SECRET_KEY = os.environ["SECRET_KEY"] -DEBUG = os.environ["DB_DEBUG"] +DEBUG = False ROOT_URLCONF = "project.urls" -ALLOWED_HOSTS = os.environ['DB_ALLOWED_HOSTS'] +ALLOWED_HOSTS = os.environ['ALLOWED_HOSTS'] BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) From b9563c925c125aa48a17186459ec4865d9aa5a95 Mon Sep 17 00:00:00 2001 From: Zney4 <134953901+Zney4@users.noreply.github.com> Date: Mon, 14 Oct 2024 18:13:01 +0300 Subject: [PATCH 35/37] Update README.md --- README.md | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 3abcb6a48..613dd151d 100644 --- a/README.md +++ b/README.md @@ -23,13 +23,10 @@ DB_PORT=example DB_NAME=example DB_USER=example DB_PASSWORD=example -DB_DEBUG=example -DB_ALLOWED_HOSTS=example -``` -В файле settings.py есть настройка DEBUG, она включает отладочный режим работы сайта. На локальной машине она обычно равна True, а на сервере — False. -``` -DB_DEBUG=example +ALLOWED_HOSTS=example +SECRET_KEY=example ``` + #### Для запуска сайта ``` python main From 441b6c6fe05d03ff2bd47de45f51c7fb171712bd Mon Sep 17 00:00:00 2001 From: Zney4 <134953901+Zney4@users.noreply.github.com> Date: Mon, 21 Oct 2024 18:15:37 +0300 Subject: [PATCH 36/37] fix code --- project/settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/settings.py b/project/settings.py index 50311d579..fee7e1aca 100644 --- a/project/settings.py +++ b/project/settings.py @@ -17,7 +17,7 @@ SECRET_KEY = os.environ["SECRET_KEY"] -DEBUG = False +DEBUG = os.getenv('DEBUG', 'False').lower() in ('true', '1', 't', 'yes') ROOT_URLCONF = "project.urls" From eb09eaeb21106667cf5518d75e72989d4fef986b Mon Sep 17 00:00:00 2001 From: Zney4 <134953901+Zney4@users.noreply.github.com> Date: Mon, 21 Oct 2024 18:21:29 +0300 Subject: [PATCH 37/37] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 613dd151d..b6c1ce1d9 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,8 @@ DB_PASSWORD=example ALLOWED_HOSTS=example SECRET_KEY=example ``` - +В файле settings.py есть настройка `DEBUG`, она включает отладочный режим работы сайта. На локальной машине она обычно равна True, а на сервере — False. Чтобы случайно не отправить `DEBUG` = True на сервер вместе с очередным коммитом, эту настройку выносят в переменную окружения. + #### Для запуска сайта ``` python main