|
25 | 25 | "dj_rest_auth", |
26 | 26 | "dj_rest_auth.registration", |
27 | 27 |
|
| 28 | + # drf-spectacular |
| 29 | + "drf_spectacular", |
| 30 | + |
28 | 31 | # Allauth |
29 | 32 | "allauth", |
| 33 | + "allauth.account", |
30 | 34 | "allauth.socialaccount", |
31 | 35 | "allauth.socialaccount.providers.google", |
32 | 36 | "allauth.socialaccount.providers.github", |
|
51 | 55 | "django.middleware.clickjacking.XFrameOptionsMiddleware", |
52 | 56 | ] |
53 | 57 |
|
| 58 | +REST_FRAMEWORK = { |
| 59 | + "DEFAULT_AUTHENTICATION_CLASSES": ("rest_framework_simplejwt.authentication.JWTAuthentication",), |
| 60 | + "DEFAULT_PERMISSION_CLASSES": ("rest_framework.permissions.IsAuthenticated",), |
| 61 | + "DEFAULT_PAGINATION_CLASS": "rest_framework.pagination.PageNumberPagination", |
| 62 | + "PAGE_SIZE": 20, |
| 63 | + "DEFAULT_SCHEMA_CLASS": "drf_spectacular.openapi.AutoSchema", |
| 64 | +} |
| 65 | + |
| 66 | +SPECTACULAR_SETTINGS = { |
| 67 | + "TITLE": "Simlog API", |
| 68 | + "DESCRIPTION": "Django REST API for a flight simulator companion app.", |
| 69 | + "VERSION": "1.0", |
| 70 | + "SERVE_INCLUDE_SCHEMA": False, |
| 71 | + |
| 72 | + "AUTHENTICATION_CLASSES": ( |
| 73 | + "rest_framework_simplejwt.authentication.JWTAuthentication", |
| 74 | + ), |
| 75 | + "SWAGGER_UI_SETTINGS": { |
| 76 | + "persistAuthorization": True, |
| 77 | + }, |
| 78 | +} |
| 79 | + |
54 | 80 | ROOT_URLCONF = "core.urls" |
55 | 81 |
|
56 | 82 | SITE_ID = 1 |
|
113 | 139 |
|
114 | 140 | DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField" |
115 | 141 |
|
116 | | -REST_FRAMEWORK = { |
117 | | - "DEFAULT_AUTHENTICATION_CLASSES": ("rest_framework_simplejwt.authentication.JWTAuthentication",), |
118 | | - "DEFAULT_PERMISSION_CLASSES": ("rest_framework.permissions.IsAuthenticated",), |
119 | | - "DEFAULT_PAGINATION_CLASS": "rest_framework.pagination.PageNumberPagination", |
120 | | - "PAGE_SIZE": 20, |
121 | | -} |
122 | | - |
123 | 142 | MEDIA_URL = "/media/" |
124 | 143 | MEDIA_ROOT = os.path.join(BASE_DIR, "media") |
0 commit comments