File tree 4 files changed +9
-13
lines changed
4 files changed +9
-13
lines changed Original file line number Diff line number Diff line change 1
1
web : cd backend && gunicorn website.wsgi
2
- release : cd backend && python manage.py makemigrations && python manage.py migrate
2
+ release : cd backend && python manage.py makemigrations account && python manage.py makemigrations && python manage.py migrate
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ def authenticate(self, request):
20
20
)
21
21
22
22
except jwt .ExpiredSignatureError :
23
- raise exceptions .AuthenticationFalied ("Access token has expired!" )
23
+ raise exceptions .AuthenticationFailed ("Access token has expired!" )
24
24
25
25
except IndexError :
26
26
raise exceptions .AuthenticationFalied ("Token missing!" )
Original file line number Diff line number Diff line change @@ -23,7 +23,9 @@ def post(self, request):
23
23
24
24
uuid = serializer .validated_data ["uuid" ]
25
25
26
- User .objects .get_or_create (uuid = uuid , role = "admin" )
26
+ user , created = User .objects .get_or_create (uuid = uuid )
27
+ user .role = "admin"
28
+ user .save ()
27
29
28
30
access_token = generate_access_token (uuid , "admin" )
29
31
refresh_token = generate_refresh_token (uuid , "admin" )
Original file line number Diff line number Diff line change 15
15
from decouple import config
16
16
import django_heroku
17
17
18
+ import dj_database_url
19
+
18
20
# Build paths inside the project like this: BASE_DIR / 'subdir'.
19
21
BASE_DIR = Path (__file__ ).resolve ().parent .parent
20
22
85
87
# Database
86
88
# https://docs.djangoproject.com/en/3.2/ref/settings/#databases
87
89
88
- DATABASES = {
89
- "default" : {
90
- "ENGINE" : "django.db.backends.postgresql_psycopg2" ,
91
- "NAME" : "postgres" ,
92
- "USER" : "postgres" ,
93
- "PASSWORD" : config ("DB_PASSWORD" ),
94
- "HOST" : "localhost" ,
95
- "PORT" : "5432" ,
96
- }
97
- }
90
+ DATABASES = {}
91
+ DATABASES ['default' ] = dj_database_url .config (conn_max_age = 600 , ssl_require = True )
98
92
99
93
# Password validation
100
94
# https://docs.djangoproject.com/en/3.2/ref/settings/#auth-password-validators
You can’t perform that action at this time.
0 commit comments