From 65ad4a5f21599efb1f199878b7ae4927e57e9e7c Mon Sep 17 00:00:00 2001 From: keannu125 Date: Wed, 1 Mar 2023 22:58:22 +0800 Subject: [PATCH 1/7] Notes now has owner foreign key --- project/db.sqlite3 | Bin 151552 -> 151552 bytes project/notes/migrations/0006_note_owner.py | 21 ++++++++++++++++++ .../notes/migrations/0007_alter_note_owner.py | 21 ++++++++++++++++++ .../notes/migrations/0008_alter_note_owner.py | 21 ++++++++++++++++++ project/notes/models.py | 3 +++ project/notes/views.py | 10 +++++++-- 6 files changed, 74 insertions(+), 2 deletions(-) create mode 100644 project/notes/migrations/0006_note_owner.py create mode 100644 project/notes/migrations/0007_alter_note_owner.py create mode 100644 project/notes/migrations/0008_alter_note_owner.py diff --git a/project/db.sqlite3 b/project/db.sqlite3 index 4b4b685f771c003d0c153eee6c041e7cfc2ef6cd..a15a2912cf476160b42332e0e70a1ecc4725f8c8 100644 GIT binary patch delta 2360 zcmai0TWs4@81|o=i?q>ey^cs{CzG}}+HTrD zvW?lgsXwVJ)JZBuHCV4#Q_gp+J7lk!U=pcPxl)+oI4+sVj#mnk8MU7&PnQalJjcg- zIsA{YF`-{b_KSR9OiT!z5ci-x*r5fXadBkBQ(6GaJq;1TqI zAc>NURy?vEhzqhLA;BBf1H2?BVrbgSZ35zQf#tX3+>xo#=w|jl0AGf2uR&;M~ko2v#+XjOqKKmfjWksn$&!7jl0})cwrPWdw zc0esJh)*;K_mZp1>Wo!sH4Z+yR1Ug4==HjB+uud1+UjIgoW`t<4EEu_ zJ_jD<{W5q+b_cg1(x9xA!AaU|2JmX6%li*?90Qo>_)hSiF+%`&ZYGwyLO3YQ4Y>Mq^cMz6r3#WguI>OX`bTwv&#GDw6Tt=I1#DnGfL;V zfkQ9WNkJzKk(VIw{3pAV@$U0?sc1nUou`##_a|l>V>P`vUSwE!svWb8xU#uYtOy|_ zH|0N?3*wMCEt=LhIO#_yz|YwH61GL-9eKHXTwllg!?4 zI#`Gp5gl#q*qITRv{Tx=p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hn>SgkO3 z=rPL~HTfy3#r4N;fIaImK-|QLn`pPaM%agSUi^NGSk2r4@fJqBg?#=%z&@P|zxSN0 zo29)|!HDZbmKf>0*{L9y`<*p+yZ*8ZLF@cTKkVE%>J{G^#QzI>-DJMnQ z1sd`cgS*?b*klNW7$=KyD4|OpPs;-8nUtb&QHa)Po`zA8|j;Nr{!nI3=N&A~G+s=*=giBZY!IqVm@5UHh>Dz3`!6rx2+EY*Qz# zov>o)Zf7OFPwcf3UNjG#L~UGm`D4#QyK4M#nbvE@_an1*$fi!i@llK&A*^jocNzb< zq%vhw4%OcP diff --git a/project/notes/migrations/0006_note_owner.py b/project/notes/migrations/0006_note_owner.py new file mode 100644 index 0000000..4ffa86d --- /dev/null +++ b/project/notes/migrations/0006_note_owner.py @@ -0,0 +1,21 @@ +# Generated by Django 4.1.7 on 2023-03-01 13:47 + +from django.conf import settings +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ('notes', '0005_delete_historicalnote'), + ] + + operations = [ + migrations.AddField( + model_name='note', + name='owner', + field=models.ForeignKey(default=0, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL), + ), + ] diff --git a/project/notes/migrations/0007_alter_note_owner.py b/project/notes/migrations/0007_alter_note_owner.py new file mode 100644 index 0000000..c307cfd --- /dev/null +++ b/project/notes/migrations/0007_alter_note_owner.py @@ -0,0 +1,21 @@ +# Generated by Django 4.1.7 on 2023-03-01 13:51 + +from django.conf import settings +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ('notes', '0006_note_owner'), + ] + + operations = [ + migrations.AlterField( + model_name='note', + name='owner', + field=models.ForeignKey(blank=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL), + ), + ] diff --git a/project/notes/migrations/0008_alter_note_owner.py b/project/notes/migrations/0008_alter_note_owner.py new file mode 100644 index 0000000..cfc1777 --- /dev/null +++ b/project/notes/migrations/0008_alter_note_owner.py @@ -0,0 +1,21 @@ +# Generated by Django 4.1.7 on 2023-03-01 14:48 + +from django.conf import settings +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ('notes', '0007_alter_note_owner'), + ] + + operations = [ + migrations.AlterField( + model_name='note', + name='owner', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL), + ), + ] diff --git a/project/notes/models.py b/project/notes/models.py index 78a5a74..b2363f6 100644 --- a/project/notes/models.py +++ b/project/notes/models.py @@ -1,5 +1,7 @@ from django.db import models from django.utils.timezone import now +from django.contrib.auth import get_user_model +User = get_user_model() # Create your models here. @@ -7,6 +9,7 @@ class Note(models.Model): title = models.CharField(max_length=20) content = models.CharField(max_length=1024) date_created = models.DateTimeField(default=now, editable=False) + owner = models.ForeignKey(User, on_delete=models.CASCADE) def __str__(self): return self.title diff --git a/project/notes/views.py b/project/notes/views.py index a7165a7..957dcea 100644 --- a/project/notes/views.py +++ b/project/notes/views.py @@ -1,9 +1,15 @@ -from django.shortcuts import render +from rest_framework.permissions import IsAuthenticated from rest_framework import viewsets from .serializers import NoteSerializer from .models import Note class NoteViewSet(viewsets.ModelViewSet): - queryset = Note.objects.all().order_by('date_created') + permission_classes = [IsAuthenticated] serializer_class = NoteSerializer + queryset = Note.objects.all() + + def get_queryset(self): + user = self.request.user + queryset = Note.objects.filter(owner=user).order_by('date_created') + return queryset From ff7934407a3fdf8097004d9db3dd31226a3cb8f0 Mon Sep 17 00:00:00 2001 From: keannu125 Date: Wed, 1 Mar 2023 23:27:46 +0800 Subject: [PATCH 2/7] Added a custom user serializer to allow sorting of notes by user --- project/accounts/serializers.py | 12 ++++++++++++ project/config/settings.py | 6 +++++- project/db.sqlite3 | Bin 151552 -> 151552 bytes project/notes/serializers.py | 4 +++- project/notes/views.py | 3 +++ 5 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 project/accounts/serializers.py diff --git a/project/accounts/serializers.py b/project/accounts/serializers.py new file mode 100644 index 0000000..060f147 --- /dev/null +++ b/project/accounts/serializers.py @@ -0,0 +1,12 @@ +from django.contrib.auth.models import User +from rest_framework import serializers +from notes.models import Note + + +class CustomUserSerializer(serializers.ModelSerializer): + notes = serializers.PrimaryKeyRelatedField( + many=True, queryset=Note.objects.all()) + + class Meta: + model = User + fields = ['id', 'username', 'notes'] diff --git a/project/config/settings.py b/project/config/settings.py index 3a92483..8bab837 100644 --- a/project/config/settings.py +++ b/project/config/settings.py @@ -41,7 +41,8 @@ INSTALLED_APPS = [ 'rest_framework.authtoken', 'notes.apps.NotesConfig', 'corsheaders', - 'djoser' + 'djoser', + 'accounts', ] MIDDLEWARE = [ @@ -146,6 +147,9 @@ DJOSER = { 'SEND_ACTIVATION_EMAIL': True, 'SEND_CONFIRMATION_EMAIL': True, 'ACTIVATION_URL': 'activation/{uid}/{token}', + 'SERIALIZERS': { + 'user': 'accounts.serializers.CustomUserSerializer' + }, } EMAIL_HOST = 'sandbox.smtp.mailtrap.io' diff --git a/project/db.sqlite3 b/project/db.sqlite3 index a15a2912cf476160b42332e0e70a1ecc4725f8c8..68766b596ce1b3de26621d1d49aadde8e76d9eff 100644 GIT binary patch delta 1634 zcma)+OKcle6ozL!Nt=mqZmSR?1Z~nbLLkS^y?5RgmFhTloH%~Pj$<1|>DcqK`hZnV(+4FXx#b65bbkT^BanW*K3B1IevC3uj1kB#B}+wXqs19ht1fFfpVN}O?#Jcy3fB$^9j)MREJs2S%MxaS z0hTS8id<{g{s|04FJwI;%R`2j6|-3BnP>2Jov}y463=sc)8v2Y+vyA3G!$g|mS&SX zEn~5=951ez#Y}4|S*>TviAZUonbM0TXo?H|=Azzcq!LJprcovAQsHJG-Cii@{~|E- z2n>rvwks{_nd7_@y>dY0<&Z}b5Rc%n-C`7YK!D%CAK-!AdEbLGG&N543Pg3kdZ{~x zsByX%^wZseQ$r455#V!R+5QF4nRg7V`AAJ=I8Ej9C@kCP0aiMUBhzjFwlSCh-{Z%u%4T{U(FB z+hh`hFlM`1IlxWAo~xTS<3}JnO|3mQp~FS3JvW7|$K;KH!^0CKcuauD_HDm|(*!X< zku=@KcOLOeps*znt6~l>A5Ct2Vdab>((&q9_M#NdQE@ap(SqtuPLB(7RXP7pt z$I}rh5o+n%sg4rcl7*#Eyl9AvQ5@e|&1SZ=)OxCB;Yh<>FNf+IE7eUIwQ*keWtU+j zX9TRG+-&(bqOG~Z&9GV( z6;yX9mkw>`s_Pm~?6`4&YeXwyF@~B;X0&-EHsZS5>*;0C(+%7qz#UuYZvgu`b%Gch z^YuofH!^?Ud%TwuJR;8t5cPZE9s%yze|`%*7pMsRe`@#txle%mpABDf`~c3Lq3rQ^ Ja>a4DzX08ByK4Xd delta 212 zcmZozz}c{XbAmLZ-b5K^M!k&*i{!;tFtGEdGw{FUzrw$pKb^mue-?iYf5v9P0)PI= z>H4CqynM`x9FrUMCDnMinB_SVOG`51ON&#B7#J9YA-sarqTI~l;>>(;W@cl?$p?9a z**Jxnm~}Ze-_+MO*v#^PU4W5&vtYw}{)qvsiw+2EI=~{p!5{!MfPsMvRr~=^^&k03 h6IhnB9AFdxYu(QMfbl0kSRASsD(t{?oqys2IRLO3LdpOD diff --git a/project/notes/serializers.py b/project/notes/serializers.py index c4c74cd..d3c12d3 100644 --- a/project/notes/serializers.py +++ b/project/notes/serializers.py @@ -3,6 +3,8 @@ from .models import Note class NoteSerializer(serializers.HyperlinkedModelSerializer): + owner = serializers.ReadOnlyField(source='owner.username') + class Meta: model = Note - fields = ('id', 'title', 'content', 'date_created') + fields = ('id', 'title', 'content', 'date_created', 'owner') diff --git a/project/notes/views.py b/project/notes/views.py index 957dcea..ee53847 100644 --- a/project/notes/views.py +++ b/project/notes/views.py @@ -13,3 +13,6 @@ class NoteViewSet(viewsets.ModelViewSet): user = self.request.user queryset = Note.objects.filter(owner=user).order_by('date_created') return queryset + + def perform_create(self, serializer): + serializer.save(owner=self.request.user) From 428423c2cc410215703373b39df15eca81674f43 Mon Sep 17 00:00:00 2001 From: keannu125 Date: Fri, 3 Mar 2023 23:47:30 +0800 Subject: [PATCH 3/7] Made content field for note unlimited --- project/accounts/serializers.py | 5 +++-- project/db.sqlite3 | Bin 151552 -> 241664 bytes .../migrations/0009_alter_note_content.py | 18 ++++++++++++++++++ project/notes/models.py | 2 +- 4 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 project/notes/migrations/0009_alter_note_content.py diff --git a/project/accounts/serializers.py b/project/accounts/serializers.py index 060f147..2d990c4 100644 --- a/project/accounts/serializers.py +++ b/project/accounts/serializers.py @@ -5,8 +5,9 @@ from notes.models import Note class CustomUserSerializer(serializers.ModelSerializer): notes = serializers.PrimaryKeyRelatedField( - many=True, queryset=Note.objects.all()) + many=True, allow_null=True, queryset=Note.objects.all()) class Meta: model = User - fields = ['id', 'username', 'notes'] + fields = ['id', 'username', 'notes',] + read_only_fields = ['id', 'notes'] diff --git a/project/db.sqlite3 b/project/db.sqlite3 index 68766b596ce1b3de26621d1d49aadde8e76d9eff..7180d3e705030a37cb3a444f6abffb63cc166660 100644 GIT binary patch literal 241664 zcmeI5eQXSfRU2|p0!+GJ0e4AaaOxs#pk}b=-);1e=hqz#al258atiX7UYxcqTx3tZbYKygWMeNR%{6_;yLwCNv*1W0mi zkvpJw0s4EM8FGd%k{F-XYuR5y91Z7rp5OeQ&-45J=6RVRZ{56Js2QQ9a%EMog%sCe zmms*_3WZ!Q*EYQ`()$d(`{{j)-X40_UqXFnm;c+YiS)@{${>i}XW4?{_x+~^zB};h zz`yi;!~5sHU+Vj6Z{G8>?mzDNi=H{*=Ul(Di>$7aw%$DI4c;9WwyK3v&Um1&*Ot@k zRil#5SIX;aRdc_PGe4$jC!s2ul$EmS^-|$pYxZMP^Qq)QDs+2x`sVFaXnOWi>P~2+ zHP;?OM?!P6?S)1{=SH|cWHn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p9)izNjWj0NV1fOVKok`arSbHy@%B} etj0YBt8oZV2v2rUviA_45T5owJW(g_{Qn1bRHR4% delta 790 zcmZp8z}K*VbAq&>8v_G_DiFhf|3n>QMz@U#OZb^(IWA6S7qH%}sL;=``J#jyJ7dOX z!2*B&$?5tgjC_;l=*zJ&i!(DDGfqCpBRu)Cz7C`8CIc1&E@s}(4E%w7i+Dc+wLayY z{5iL9^0N7YlS}g!N|;(1SXddD=vkPU85o--rsQVkfr-iWdE%2@^J}FI6%0+SjLfZ! z4D`&6O$;qeN>YnU48a6g&6j)uE@uA64E%5Tzwb{(J`h9sKz~ zCnobx&YwROD6*V^{|f(dpvY|g&CA!?{lnj8CVZc4W+~Z?v#r7f&~3Y)s6|OG&NB%Lm#XpOINyl3$dWoR|aRL%EglrNya5 z@tG;{Nfs97$;L@(*c7We2e~?ixGH%1xwu9sC}C5AY+gNzfl3Pge%SRWDQGA`Tm^TA zk|qNKvx0ac(Cwjw-JX&N^oVhirKL%lks-oW^$2gOkl=C@(};65NDIixOnKtIKqu>F zHi}rYi*LV}!`Q*dRBbWcAe*s2p{`>i}itwvyceq-SO!~YE!>96>wfB4VH!p6+R z%*@HTZ2{w7{_TJHnV1Ep1u(I)@?T@%zXnuwhF?pAnT Date: Sat, 4 Mar 2023 17:18:11 +0800 Subject: [PATCH 4/7] Made date_created serialize to 12 hour time format --- project/db.sqlite3 | Bin 241664 -> 241664 bytes project/notes/serializers.py | 1 + 2 files changed, 1 insertion(+) diff --git a/project/db.sqlite3 b/project/db.sqlite3 index 7180d3e705030a37cb3a444f6abffb63cc166660..1c85f91081b283fe6e4168cd26a95d3743650b70 100644 GIT binary patch delta 68 zcmZp8z}N7AZ-O*q_e2?I#_o*?N%_(y3I>)|hUQi#W_rfvmWIZrC8@ Date: Sat, 4 Mar 2023 19:25:40 +0800 Subject: [PATCH 5/7] Hotfix for not being able to POST with changed 12 hour datetime format --- project/db.sqlite3 | Bin 241664 -> 241664 bytes .../notes/migrations/0010_alter_note_owner.py | 21 ++++++++++++++++++ .../notes/migrations/0011_alter_note_owner.py | 21 ++++++++++++++++++ project/notes/serializers.py | 4 +++- 4 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 project/notes/migrations/0010_alter_note_owner.py create mode 100644 project/notes/migrations/0011_alter_note_owner.py diff --git a/project/db.sqlite3 b/project/db.sqlite3 index 1c85f91081b283fe6e4168cd26a95d3743650b70..de614f80a91241255c9c49690e9fe1510fbb9e91 100644 GIT binary patch delta 430 zcmZp8z}N7AZ-O-MLIwr~YamtzVzG%D=8OwBCM@A+R^X7E%r0Qd!V$?Kw>ePY8oPj{ z0xN^Kxno{_NouiyfuZ5#hZ0hXCJKgzR)%I)rUrUuCI*H^CYJIjstiD?1i`8dEUZk- z^b9Oajg2ifPmvH6XJnncNv=bH?tC2}}5y5ijB=X{j@U~YSXvpHTbY>Y8Jk-g8k?4+7MB=;iOKbO;>}<3w|~iJw{eWL=C+xCE|%u|@A zA5dU&nH~_zRD{Ie4&-Yv5*7gI6WM0K#Hzr_o6P`3R{Xy=2MVlV-o7iCX(J~~^N~>I a?fJ1x;XrG`nao&#cB{7~FfB`94gdf|mP)4p diff --git a/project/notes/migrations/0010_alter_note_owner.py b/project/notes/migrations/0010_alter_note_owner.py new file mode 100644 index 0000000..3b6843d --- /dev/null +++ b/project/notes/migrations/0010_alter_note_owner.py @@ -0,0 +1,21 @@ +# Generated by Django 4.1.7 on 2023-03-04 11:06 + +from django.conf import settings +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ('notes', '0009_alter_note_content'), + ] + + operations = [ + migrations.AlterField( + model_name='note', + name='owner', + field=models.ForeignKey(editable=False, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL), + ), + ] diff --git a/project/notes/migrations/0011_alter_note_owner.py b/project/notes/migrations/0011_alter_note_owner.py new file mode 100644 index 0000000..ffbbe8e --- /dev/null +++ b/project/notes/migrations/0011_alter_note_owner.py @@ -0,0 +1,21 @@ +# Generated by Django 4.1.7 on 2023-03-04 11:16 + +from django.conf import settings +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ('notes', '0010_alter_note_owner'), + ] + + operations = [ + migrations.AlterField( + model_name='note', + name='owner', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL), + ), + ] diff --git a/project/notes/serializers.py b/project/notes/serializers.py index b88fd12..b4189a4 100644 --- a/project/notes/serializers.py +++ b/project/notes/serializers.py @@ -4,8 +4,10 @@ from .models import Note class NoteSerializer(serializers.HyperlinkedModelSerializer): owner = serializers.ReadOnlyField(source='owner.username') - date_created = serializers.DateTimeField(format="%d-%m-%Y %I:%M%p") + date_created = serializers.DateTimeField( + format="%d-%m-%Y %I:%M%p", read_only=True) class Meta: model = Note fields = ('id', 'title', 'content', 'date_created', 'owner') + read_only_fields = ('id', 'date_created', 'owner') From 5c318d6dbb0a308471f91bfa1ae4a08a78858aab Mon Sep 17 00:00:00 2001 From: keannu125 Date: Sat, 4 Mar 2023 22:07:34 +0800 Subject: [PATCH 6/7] Fixed timezone for date_created --- Pipfile | 1 + Pipfile.lock | 69 +++++++++--------- project/config/settings.py | 3 +- project/db.sqlite3 | Bin 241664 -> 241664 bytes ...ove_note_date_created_note_last_updated.py | 22 ++++++ ...ove_note_last_updated_note_date_created.py | 23 ++++++ 6 files changed, 83 insertions(+), 35 deletions(-) create mode 100644 project/notes/migrations/0012_remove_note_date_created_note_last_updated.py create mode 100644 project/notes/migrations/0013_remove_note_last_updated_note_date_created.py diff --git a/Pipfile b/Pipfile index 2498513..d1a423d 100644 --- a/Pipfile +++ b/Pipfile @@ -10,6 +10,7 @@ djoser = "*" djangorestframework-simplejwt = "*" django-cors-headers = "*" python-decouple = "*" +pytz = "*" [dev-packages] autopep8 = "*" diff --git a/Pipfile.lock b/Pipfile.lock index 87e90aa..ddda774 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "2a24356df675b56c84eb1a0af12b896f6fc152d487c390124b2ed9d68d884ea0" + "sha256": "7c9c7e35e728e8bab00dae7fa5cf2fc35306cd5de74686274d85e5833c8769f4" }, "pipfile-spec": 6, "requires": { @@ -210,32 +210,32 @@ }, "cryptography": { "hashes": [ - "sha256:0f8da300b5c8af9f98111ffd512910bc792b4c77392a9523624680f7956a99d4", - "sha256:35f7c7d015d474f4011e859e93e789c87d21f6f4880ebdc29896a60403328f1f", - "sha256:4789d1e3e257965e960232345002262ede4d094d1a19f4d3b52e48d4d8f3b885", - "sha256:5aa67414fcdfa22cf052e640cb5ddc461924a045cacf325cd164e65312d99502", - "sha256:5d2d8b87a490bfcd407ed9d49093793d0f75198a35e6eb1a923ce1ee86c62b41", - "sha256:6687ef6d0a6497e2b58e7c5b852b53f62142cfa7cd1555795758934da363a965", - "sha256:6f8ba7f0328b79f08bdacc3e4e66fb4d7aab0c3584e0bd41328dce5262e26b2e", - "sha256:706843b48f9a3f9b9911979761c91541e3d90db1ca905fd63fee540a217698bc", - "sha256:807ce09d4434881ca3a7594733669bd834f5b2c6d5c7e36f8c00f691887042ad", - "sha256:83e17b26de248c33f3acffb922748151d71827d6021d98c70e6c1a25ddd78505", - "sha256:96f1157a7c08b5b189b16b47bc9db2332269d6680a196341bf30046330d15388", - "sha256:aec5a6c9864be7df2240c382740fcf3b96928c46604eaa7f3091f58b878c0bb6", - "sha256:b0afd054cd42f3d213bf82c629efb1ee5f22eba35bf0eec88ea9ea7304f511a2", - "sha256:c5caeb8188c24888c90b5108a441c106f7faa4c4c075a2bcae438c6e8ca73cef", - "sha256:ced4e447ae29ca194449a3f1ce132ded8fcab06971ef5f618605aacaa612beac", - "sha256:d1f6198ee6d9148405e49887803907fe8962a23e6c6f83ea7d98f1c0de375695", - "sha256:e124352fd3db36a9d4a21c1aa27fd5d051e621845cb87fb851c08f4f75ce8be6", - "sha256:e422abdec8b5fa8462aa016786680720d78bdce7a30c652b7fadf83a4ba35336", - "sha256:ef8b72fa70b348724ff1218267e7f7375b8de4e8194d1636ee60510aae104cd0", - "sha256:f0c64d1bd842ca2633e74a1a28033d139368ad959872533b1bab8c80e8240a0c", - "sha256:f24077a3b5298a5a06a8e0536e3ea9ec60e4c7ac486755e5fb6e6ea9b3500106", - "sha256:fdd188c8a6ef8769f148f88f859884507b954cc64db6b52f66ef199bb9ad660a", - "sha256:fe913f20024eb2cb2f323e42a64bdf2911bb9738a15dba7d3cce48151034e3a8" + "sha256:103e8f7155f3ce2ffa0049fe60169878d47a4364b277906386f8de21c9234aa1", + "sha256:23df8ca3f24699167daf3e23e51f7ba7334d504af63a94af468f468b975b7dd7", + "sha256:2725672bb53bb92dc7b4150d233cd4b8c59615cd8288d495eaa86db00d4e5c06", + "sha256:30b1d1bfd00f6fc80d11300a29f1d8ab2b8d9febb6ed4a38a76880ec564fae84", + "sha256:35d658536b0a4117c885728d1a7032bdc9a5974722ae298d6c533755a6ee3915", + "sha256:50cadb9b2f961757e712a9737ef33d89b8190c3ea34d0fb6675e00edbe35d074", + "sha256:5f8c682e736513db7d04349b4f6693690170f95aac449c56f97415c6980edef5", + "sha256:6236a9610c912b129610eb1a274bdc1350b5df834d124fa84729ebeaf7da42c3", + "sha256:788b3921d763ee35dfdb04248d0e3de11e3ca8eb22e2e48fef880c42e1f3c8f9", + "sha256:8bc0008ef798231fac03fe7d26e82d601d15bd16f3afaad1c6113771566570f3", + "sha256:8f35c17bd4faed2bc7797d2a66cbb4f986242ce2e30340ab832e5d99ae60e011", + "sha256:b49a88ff802e1993b7f749b1eeb31134f03c8d5c956e3c125c75558955cda536", + "sha256:bc0521cce2c1d541634b19f3ac661d7a64f9555135e9d8af3980965be717fd4a", + "sha256:bc5b871e977c8ee5a1bbc42fa8d19bcc08baf0c51cbf1586b0e87a2694dde42f", + "sha256:c43ac224aabcbf83a947eeb8b17eaf1547bce3767ee2d70093b461f31729a480", + "sha256:d15809e0dbdad486f4ad0979753518f47980020b7a34e9fc56e8be4f60702fac", + "sha256:d7d84a512a59f4412ca8549b01f94be4161c94efc598bf09d027d67826beddc0", + "sha256:e029b844c21116564b8b61216befabca4b500e6816fa9f0ba49527653cae2108", + "sha256:e8a0772016feeb106efd28d4a328e77dc2edae84dfbac06061319fdb669ff828", + "sha256:e944fe07b6f229f4c1a06a7ef906a19652bdd9fd54c761b0ff87e83ae7a30354", + "sha256:eb40fe69cfc6f5cdab9a5ebd022131ba21453cf7b8a7fd3631f45bbf52bed612", + "sha256:fa507318e427169ade4e9eccef39e9011cdc19534f55ca2f36ec3f388c1f70f3", + "sha256:ffd394c7896ed7821a6d13b24657c6a34b6e2650bd84ae063cf11ccffa4f1a97" ], "markers": "python_version >= '3.6'", - "version": "==39.0.1" + "version": "==39.0.2" }, "defusedxml": { "hashes": [ @@ -255,11 +255,11 @@ }, "django-cors-headers": { "hashes": [ - "sha256:37e42883b5f1f2295df6b4bba96eb2417a14a03270cb24b2a07f021cd4487cf4", - "sha256:f9dc6b4e3f611c3199700b3e5f3398c28757dcd559c2f82932687f3d0443cfdf" + "sha256:5fbd58a6fb4119d975754b2bc090f35ec160a8373f276612c675b00e8a138739", + "sha256:684180013cc7277bdd8702b80a3c5a4b3fcae4abb2bf134dceb9f5dfe300228e" ], "index": "pypi", - "version": "==3.13.0" + "version": "==3.14.0" }, "django-templated-mail": { "hashes": [ @@ -396,11 +396,11 @@ }, "python-decouple": { "hashes": [ - "sha256:1596dad2670cca5b1f87d087d9adb6a1958c590df346b85d4b19a9d6f0d52cef", - "sha256:e88a8d6bdf3b07d471a854099e455e20a6fa7a4d6ecf8631b250e3db654336e6" + "sha256:ba6e2657d4f376ecc46f77a3a615e058d93ba5e465c01bbe57289bfb7cce680f", + "sha256:d0d45340815b25f4de59c974b855bb38d03151d81b037d9e3f463b0c9f8cbd66" ], "index": "pypi", - "version": "==3.7" + "version": "==3.8" }, "python3-openid": { "hashes": [ @@ -414,6 +414,7 @@ "sha256:01a0681c4b9684a28304615eba55d1ab31ae00bf68ec157ec3708a8182dbbcd0", "sha256:78f4f37d8198e0627c5f1143240bb0206b8691d8d7ac6d78fee88b78733f8c4a" ], + "index": "pypi", "version": "==2022.7.1" }, "requests": { @@ -492,11 +493,11 @@ "develop": { "autopep8": { "hashes": [ - "sha256:be5bc98c33515b67475420b7b1feafc8d32c1a69862498eda4983b45bffd2687", - "sha256:d27a8929d8dcd21c0f4b3859d2d07c6c25273727b98afc984c039df0f0d86566" + "sha256:86e9303b5e5c8160872b2f5ef611161b2893e9bfe8ccc7e2f76385947d57a2f1", + "sha256:f9849cdd62108cb739dbcdbfb7fdcc9a30d1b63c4cc3e1c1f893b5360941b61c" ], "index": "pypi", - "version": "==2.0.1" + "version": "==2.0.2" }, "pycodestyle": { "hashes": [ diff --git a/project/config/settings.py b/project/config/settings.py index 8bab837..5f31838 100644 --- a/project/config/settings.py +++ b/project/config/settings.py @@ -11,6 +11,7 @@ https://docs.djangoproject.com/en/4.1/ref/settings/ """ from pathlib import Path +import pytz # Build paths inside the project like this: BASE_DIR / 'subdir'. BASE_DIR = Path(__file__).resolve().parent.parent @@ -112,7 +113,7 @@ AUTH_PASSWORD_VALIDATORS = [ LANGUAGE_CODE = 'en-us' -TIME_ZONE = 'UTC' +TIME_ZONE = 'Asia/Manila' USE_I18N = True diff --git a/project/db.sqlite3 b/project/db.sqlite3 index de614f80a91241255c9c49690e9fe1510fbb9e91..42d09acb6b4f6a26f22ca6cc130b5f31cd60b04c 100644 GIT binary patch delta 710 zcmZp8z}N7AZ-TVoY6b=dYamtzVlg0&ov35XxO!v45`JbS_L9l$0*)-~C)rCj2MTDg z*9R-HGKgn8=H-{978@8C8pju<=H{2B#)Aana}tY7;!6us5=&B3AR-`Ud~#7LNW{p% z$XM3^h)fg=jjc>AtPG6x%*~AqOf7>IQ4BRgF%;Q|cx?=O&`dSAGBwaMGBLEUFxxCA z@sph~XtQ8}6~8Ed4TC6SUTS$f*j>e7l67*rz6rk|vmztdJ76)6$*c538I?8}9JQA) zu`)2VGBMIKGcq$bHV1mR#1KqOuFn(S{3YM&0~6nc?FI>qO3aK7+k=xC@31pEPB+MA ztYvhVzAl@wXZo)MMzQIUIgByWt#TOUx1Y{oWMy(}(sf`L*Vbli5iChe%1K3Y6B<{| zImp#9#8n~0(aFbEK?y87eQp9{F_N+W{TUerHho}G*v_(m@pnEW$2I{bbpb|`=^6@5 z#;oeV7*(9UQGv;6d%#rYDNNH3C@{H94+v!{LgH@+@--L<3xM>AY%^eDQ(!sIz<(YX zw1@d^%@p-H*cjv`IUN&=Q;-pI)Ih@0T+hVR)Wpn$7w9Mk0R{&CCtxFt%@h?m9ZTSP bVJs6BHgrSv@ ziIs_ko`r>hsktRkQ;8v%m|UMHzWGbO)dwc-Iok~q7?qeAZMFv|Gu~lmw4H8{%~;E5 zGksk)W6$&l`Hb?@Tk;uWrsw4|ifuog!^p~{RTQ6@qNK^dz^EmzsL0qNS(2EPlZtQv zf~7pYKY_7CtSqr8IU})1!_dIUL{q`fKSaSV)W>J~-F!wRklB$;np~S1A21tiXIa4b zJD-ttn*fu#0HgYJ4Fx7+Mw96q6`0(%2TWz2!ZiJW0+Y*hAhQUG4`OOC5*7gI6WM0K z#HPS;ih=(WgBAbp&4B`In78km%*@Tq!oa|3z5V1e=0$AU3=B+DIT*wpIomrj!NFx@ zU}UUo0743erdB4#Rwkx;rY7c=W=7iu3z!U;?0_+7Wx~qFpy Date: Sun, 5 Mar 2023 22:06:16 +0800 Subject: [PATCH 7/7] Removed unused timezone import insettings.py --- project/config/settings.py | 1 - project/db.sqlite3 | Bin 241664 -> 241664 bytes 2 files changed, 1 deletion(-) diff --git a/project/config/settings.py b/project/config/settings.py index 5f31838..452fe0b 100644 --- a/project/config/settings.py +++ b/project/config/settings.py @@ -11,7 +11,6 @@ https://docs.djangoproject.com/en/4.1/ref/settings/ """ from pathlib import Path -import pytz # Build paths inside the project like this: BASE_DIR / 'subdir'. BASE_DIR = Path(__file__).resolve().parent.parent diff --git a/project/db.sqlite3 b/project/db.sqlite3 index 42d09acb6b4f6a26f22ca6cc130b5f31cd60b04c..be67ebffec369e1b9a2488949b76098513b8083b 100644 GIT binary patch delta 250 zcmZp8z}N7AZ-O-A;fXTNjE6TScp=_h8B7j<|YP4=4}Z~%MzFa0N$fQ A0{{R3 delta 187 zcmZp8z}N7AZ-O-A>WMPWjH@>$cFp$SmT%EU;|%*f2#*t{gQxWo`lOs>xpZ~l_M{YyThzyuCP{@)Dzzxls!7HoLO z&&J8Z%*n{HO@N8TfsK*>JOlsv&4LAo`HjsK^*PuW