File tree 4 files changed +3
-21
lines changed 4 files changed +3
-21
lines changed Original file line number Diff line number Diff line change 12
12
13
13
import os
14
14
15
- from datetime import timedelta
16
-
17
15
from .env_reader import env
18
16
19
17
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
153
151
STATIC_URL = '/static/'
154
152
STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
155
153
156
-
157
- # https://django-rest-framework-simplejwt.readthedocs.io/en/latest/settings.html
158
- SIMPLE_JWT = {
159
- 'ACCESS_TOKEN_LIFETIME' : timedelta (days = 30 ),
160
- 'REFRESH_TOKEN_LIFETIME' : timedelta (days = 31 ),
161
- # TODO: Open issue for having a callable with a user here
162
- 'SIGNING_KEY' : env ('DJANGO_JWT_SIGNING_KEY' , default = SECRET_KEY )
163
- # TODO: https://github.com/SimpleJWT/django-rest-framework-simplejwt/pull/157/files
164
- # Add settings for http support
165
- }
166
-
167
154
REST_FRAMEWORK = {
168
155
'EXCEPTION_HANDLER' : 'styleguide_example.api.errors.custom_exception_handler' ,
169
156
'DEFAULT_FILTER_BACKENDS' : (
Original file line number Diff line number Diff line change @@ -2,7 +2,6 @@ Django==3.1.6
2
2
django-environ==0.4.5
3
3
psycopg2==2.8.5
4
4
djangorestframework==3.11.2
5
- djangorestframework-simplejwt==4.4.0
6
5
7
6
celery==4.4.6
8
7
django-celery-results==1.2.1
Original file line number Diff line number Diff line change 2
2
3
3
from rest_framework import exceptions as rest_exceptions
4
4
from rest_framework .permissions import IsAuthenticated
5
- from rest_framework_simplejwt .authentication import JWTAuthentication
5
+ from rest_framework .authentication import SessionAuthentication
6
6
7
7
from styleguide_example .api .errors import get_error_message
8
8
9
9
10
10
class ApiAuthMixin :
11
- authentication_classes = (JWTAuthentication , )
11
+ authentication_classes = (SessionAuthentication , )
12
12
permission_classes = (IsAuthenticated , )
13
13
14
14
Original file line number Diff line number Diff line change 1
1
from rest_framework .views import APIView
2
2
from rest_framework .response import Response
3
3
4
- from rest_framework_simplejwt .views import (
5
- TokenObtainPairView ,
6
- )
7
-
8
4
from styleguide_example .api .mixins import ApiAuthMixin
9
5
10
6
from styleguide_example .users .selectors import user_get_login_data
11
7
12
8
13
- class UserLoginApi (TokenObtainPairView ):
9
+ class UserLoginApi (APIView ):
14
10
pass
15
11
16
12
You can’t perform that action at this time.
0 commit comments