We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Add `djangorestframework-simplejwt` and add Django endpoints. ( Easiest part NGL )
Gonna leave it as is till i finish other stuff



--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `backend/core/urls.py`
Content:
```
1 """core URL Configuration
2 
3 The `urlpatterns` list routes URLs to views. For more information please see:
4     https://docs.djangoproject.com/en/3.2/topics/http/urls/
5 Examples:
6 Function views
7     1. Add an import:  from my_app import views
8     2. Add a URL to urlpatterns:  path('', views.home, name='home')
9 Class-based views
10     1. Add an import:  from other_app.views import Home
11     2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
12 Including another URLconf
13     1. Import the include() function: from django.urls import include, path
14     2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
15 """
16 from django.contrib import admin
17 from django.urls import path
18 from django.urls import include
19 from django.conf.urls.static import static
20 from django.conf import settings
21 
22 urlpatterns = [
23     path("admin/", admin.site.urls),
24     # Pages
25     path("user/", include("pages.users.urls")),
26     path("authentication/", include("pages.authentication.urls")),
27     # Api
28     path("api/v1/avatar/", include("api.v1.avatar.urls")),
29     # Rest endpoints
30     path("api/v1/users/", include("api.v1._user.urls")),
31 ]
32 if settings.DEBUG:
33     urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
34     urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
35
```

Path: `backend/core/settings.py`
Content:
```
1 """
2 Django settings for core project.
3 
4 Generated by 'django-admin startproject' using Django 3.2.7.
5 
6 For more information on this file, see
7 https://docs.djangoproject.com/en/3.2/topics/settings/
8 
9 For the full list of settings and their values, see
10 https://docs.djangoproject.com/en/3.2/ref/settings/
11 """
12 
13 from pathlib import Path
14 import os
15 
16 # Build paths inside the project like this: BASE_DIR / 'subdir'.
17 BASE_DIR = Path(__file__).resolve().parent.parent
18 
19 
20 # Quick-start development settings - unsuitable for production
21 # See https://docs.djangoproject.com/en/3.2/howto/deployment/checklist/
22 
23 # SECURITY WARNING: keep the secret key used in production secret!
24 SECRET_KEY = "django-insecure-mn19l@e%r^s&a^pa9%(bf173v-0c54^@3s(pb!ts_yuts0$+6p"
25 
26 # SECURITY WARNING: don't run with debug turned on in production!
27 DEBUG = True
28 
29 ALLOWED_HOSTS = []
30 
31 
32 # Application definition
33 
34 INSTALLED_APPS = [
35     "django.contrib.admin",
36     "django.contrib.auth",
37     "django.contrib.contenttypes",
38     "django.contrib.sessions",
39     "django.contrib.messages",
40     "whitenoise.runserver_nostatic",
41     "django.contrib.staticfiles",
42     # Rest Framework
43     "rest_framework",
44     "rest_framework.authtoken",
45     "corsheaders",
46     # Custom Stuff
47     "custom.user",
48     # Pages
49     "pages.users",
50     "pages.authentication",
51     # Rest stuff
52     "api.v1.avatar",
53     "api.v1._user",
54 ]
55 
56 MIDDLEWARE = [
57     "django.middleware.security.SecurityMiddleware",
58     "whitenoise.middleware.WhiteNoiseMiddleware",
59     "django.contrib.sessions.middleware.SessionMiddleware",
60     "corsheaders.middleware.CorsMiddleware",
61     "django.middleware.common.CommonMiddleware",
62     "django.middleware.csrf.CsrfViewMiddleware",
63     "django.contrib.auth.middleware.AuthenticationMiddleware",
64     "django.contrib.messages.middleware.MessageMiddleware",
65     "django.middleware.clickjacking.XFrameOptionsMiddleware",
66 ]
67 
68 ROOT_URLCONF = "core.urls"
69 
70 TEMPLATES = [
71     {
72         "BACKEND": "django.template.backends.django.DjangoTemplates",
73         "DIRS": [BASE_DIR / "templates"],
74         "APP_DIRS": True,
75         "OPTIONS": {
76             "context_processors": [
77                 "django.template.context_processors.debug",
78                 "django.template.context_processors.request",
79                 "django.contrib.auth.context_processors.auth",
80                 "django.contrib.messages.context_processors.messages",
81             ],
82         },
83     },
84 ]
85 
86 WSGI_APPLICATION = "core.wsgi.application"
87 
88 
89 # Database
90 # https://docs.djangoproject.com/en/3.2/ref/settings/#databases
91 
92 DATABASES = {
93     "default": {
94         "ENGINE": "django.db.backends.sqlite3",
95         "NAME": BASE_DIR / "db.sqlite3",
96     }
97 }
98 
99 
100 # Password validation
101 # https://docs.djangoproject.com/en/3.2/ref/settings/#auth-password-validators
102 
103 AUTH_PASSWORD_VALIDATORS = [
104     {
105         "NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator",
106     },
107     {
108         "NAME": "django.contrib.auth.password_validation.MinimumLengthValidator",
109     },
110     {
111         "NAME": "django.contrib.auth.password_validation.CommonPasswordValidator",
112     },
113     {
114         "NAME": "django.contrib.auth.password_validation.NumericPasswordValidator",
115     },
116 ]
117 
118 # Custom user model
119 # https://testdriven.io/blog/django-custom-user-model/
120 
121 AUTH_USER_MODEL = "user.CustomUser"
122 
123 # Password hashers
124 # https://docs.djangoproject.com/en/3.2/topics/auth/passwords/#using-argon2-with-django
125 
126 PASSWORD_HASHERS = [
127     "django.contrib.auth.hashers.Argon2PasswordHasher",
128     "django.contrib.auth.hashers.PBKDF2PasswordHasher",
129     "django.contrib.auth.hashers.PBKDF2SHA1PasswordHasher",
130     "django.contrib.auth.hashers.BCryptSHA256PasswordHasher",
131 ]
132 
133 # Internationalization
134 # https://docs.djangoproject.com/en/3.2/topics/i18n/
135 
136 LANGUAGE_CODE = "en-us"
137 
138 TIME_ZONE = "UTC"
139 
140 USE_I18N = True
141 
142 USE_L10N = True
143 
144 USE_TZ = True
145 
146 
147 # Static files (CSS, JavaScript, Images)
148 # https://docs.djangoproject.com/en/3.2/howto/static-files/
149 STATIC_URL = "/static/"
150 
151 STATICFILES_DIRS = [
152     os.path.join(BASE_DIR, "static"),
153 ]
154 
155 STATIC_ROOT = os.path.join(BASE_DIR, "staticfiles")
156 STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage"
157 
158 MEDIA_URL = "/media/"
159 MEDIA_ROOT = os.path.join(BASE_DIR, "media")
160 # Default primary key field type
161 # https://docs.djangoproject.com/en/3.2/ref/settings/#default-auto-field
162 
163 DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"
164 
165 # Rest framework auth
166 # https://django-rest-framework-simplejwt.readthedocs.io/en/latest/getting_started.html#installation
167 REST_FRAMEWORK = {
168     "DEFAULT_AUTHENTICATION_CLASSES": (
169         "rest_framework.authentication.BasicAuthentication",
170         "rest_framework.authentication.SessionAuthentication",
171     )
172 }
173 
174 # Override the login url
175 # https://stackoverflow.com/questions/49532708/custom-login-url-in-django#49532812
176 LOGIN_URL = "login_page"
177 
178 
179 CORS_ALLOWED_ORIGINS = [
180     "http://127.0.0.1:3000",
181     "http://127.0.0.1:8000",
182     "http://localhost:3000",
183     "http://localhost:8000",
184 ]
185
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/backend/core/settings.py b/backend/core/settings.py
--- a/backend/core/settings.py
+++ b/backend/core/settings.py
@@ -41,7 +41,8 @@
     "django.contrib.staticfiles",
     # Rest Framework
     "rest_framework",
-    "rest_framework.authtoken",
+    "rest_framework_simplejwt.token_blacklist",
+    # 3rd party stuff
     "corsheaders",
     # Custom Stuff
     "custom.user",
@@ -166,6 +167,7 @@
 # https://django-rest-framework-simplejwt.readthedocs.io/en/latest/getting_started.html#installation
 REST_FRAMEWORK = {
     "DEFAULT_AUTHENTICATION_CLASSES": (
+        "rest_framework_simplejwt.authentication.JWTAuthentication",
         "rest_framework.authentication.BasicAuthentication",
         "rest_framework.authentication.SessionAuthentication",
     )
diff --git a/backend/core/urls.py b/backend/core/urls.py
--- a/backend/core/urls.py
+++ b/backend/core/urls.py
@@ -19,6 +19,12 @@
 from django.conf.urls.static import static
 from django.conf import settings
 
+from rest_framework_simplejwt.views import (
+    TokenObtainPairView,
+    TokenRefreshView,
+    TokenBlacklistView,
+)
+
 urlpatterns = [
     path("admin/", admin.site.urls),
     # Pages
@@ -26,6 +32,12 @@
     path("authentication/", include("pages.authentication.urls")),
     # Api
     path("api/v1/avatar/", include("api.v1.avatar.urls")),
+    # https://django-rest-framework-simplejwt.readthedocs.io/en/latest/getting_started.html#installation
+    path("api/v1/token/", TokenObtainPairView.as_view(), name="token_obtain_pair"),
+    path("api/v1/token/refresh/", TokenRefreshView.as_view(), name="token_refresh"),
+    path(
+        "api/v1/token/blacklist/", TokenBlacklistView.as_view(), name="token_blacklist"
+    ),
     # Rest endpoints
     path("api/v1/users/", include("api.v1._user.urls")),
 ]

{"golden_diff": "diff --git a/backend/core/settings.py b/backend/core/settings.py\n--- a/backend/core/settings.py\n+++ b/backend/core/settings.py\n@@ -41,7 +41,8 @@\n     \"django.contrib.staticfiles\",\n     # Rest Framework\n     \"rest_framework\",\n-    \"rest_framework.authtoken\",\n+    \"rest_framework_simplejwt.token_blacklist\",\n+    # 3rd party stuff\n     \"corsheaders\",\n     # Custom Stuff\n     \"custom.user\",\n@@ -166,6 +167,7 @@\n # https://django-rest-framework-simplejwt.readthedocs.io/en/latest/getting_started.html#installation\n REST_FRAMEWORK = {\n     \"DEFAULT_AUTHENTICATION_CLASSES\": (\n+        \"rest_framework_simplejwt.authentication.JWTAuthentication\",\n         \"rest_framework.authentication.BasicAuthentication\",\n         \"rest_framework.authentication.SessionAuthentication\",\n     )\ndiff --git a/backend/core/urls.py b/backend/core/urls.py\n--- a/backend/core/urls.py\n+++ b/backend/core/urls.py\n@@ -19,6 +19,12 @@\n from django.conf.urls.static import static\n from django.conf import settings\n \n+from rest_framework_simplejwt.views import (\n+    TokenObtainPairView,\n+    TokenRefreshView,\n+    TokenBlacklistView,\n+)\n+\n urlpatterns = [\n     path(\"admin/\", admin.site.urls),\n     # Pages\n@@ -26,6 +32,12 @@\n     path(\"authentication/\", include(\"pages.authentication.urls\")),\n     # Api\n     path(\"api/v1/avatar/\", include(\"api.v1.avatar.urls\")),\n+    # https://django-rest-framework-simplejwt.readthedocs.io/en/latest/getting_started.html#installation\n+    path(\"api/v1/token/\", TokenObtainPairView.as_view(), name=\"token_obtain_pair\"),\n+    path(\"api/v1/token/refresh/\", TokenRefreshView.as_view(), name=\"token_refresh\"),\n+    path(\n+        \"api/v1/token/blacklist/\", TokenBlacklistView.as_view(), name=\"token_blacklist\"\n+    ),\n     # Rest endpoints\n     path(\"api/v1/users/\", include(\"api.v1._user.urls\")),\n ]\n", "issue": "Add `djangorestframework-simplejwt` and add Django endpoints. ( Easiest part NGL )\nGonna leave it as is till i finish other stuff\r\n\r\n\n", "before_files": [{"content": "\"\"\"core URL Configuration\n\nThe `urlpatterns` list routes URLs to views. For more information please see:\n    https://docs.djangoproject.com/en/3.2/topics/http/urls/\nExamples:\nFunction views\n    1. Add an import:  from my_app import views\n    2. Add a URL to urlpatterns:  path('', views.home, name='home')\nClass-based views\n    1. Add an import:  from other_app.views import Home\n    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')\nIncluding another URLconf\n    1. Import the include() function: from django.urls import include, path\n    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))\n\"\"\"\nfrom django.contrib import admin\nfrom django.urls import path\nfrom django.urls import include\nfrom django.conf.urls.static import static\nfrom django.conf import settings\n\nurlpatterns = [\n    path(\"admin/\", admin.site.urls),\n    # Pages\n    path(\"user/\", include(\"pages.users.urls\")),\n    path(\"authentication/\", include(\"pages.authentication.urls\")),\n    # Api\n    path(\"api/v1/avatar/\", include(\"api.v1.avatar.urls\")),\n    # Rest endpoints\n    path(\"api/v1/users/\", include(\"api.v1._user.urls\")),\n]\nif settings.DEBUG:\n    urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)\n    urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)\n", "path": "backend/core/urls.py"}, {"content": "\"\"\"\nDjango settings for core project.\n\nGenerated by 'django-admin startproject' using Django 3.2.7.\n\nFor more information on this file, see\nhttps://docs.djangoproject.com/en/3.2/topics/settings/\n\nFor the full list of settings and their values, see\nhttps://docs.djangoproject.com/en/3.2/ref/settings/\n\"\"\"\n\nfrom pathlib import Path\nimport os\n\n# Build paths inside the project like this: BASE_DIR / 'subdir'.\nBASE_DIR = Path(__file__).resolve().parent.parent\n\n\n# Quick-start development settings - unsuitable for production\n# See https://docs.djangoproject.com/en/3.2/howto/deployment/checklist/\n\n# SECURITY WARNING: keep the secret key used in production secret!\nSECRET_KEY = \"django-insecure-mn19l@e%r^s&a^pa9%(bf173v-0c54^@3s(pb!ts_yuts0$+6p\"\n\n# SECURITY WARNING: don't run with debug turned on in production!\nDEBUG = True\n\nALLOWED_HOSTS = []\n\n\n# Application definition\n\nINSTALLED_APPS = [\n    \"django.contrib.admin\",\n    \"django.contrib.auth\",\n    \"django.contrib.contenttypes\",\n    \"django.contrib.sessions\",\n    \"django.contrib.messages\",\n    \"whitenoise.runserver_nostatic\",\n    \"django.contrib.staticfiles\",\n    # Rest Framework\n    \"rest_framework\",\n    \"rest_framework.authtoken\",\n    \"corsheaders\",\n    # Custom Stuff\n    \"custom.user\",\n    # Pages\n    \"pages.users\",\n    \"pages.authentication\",\n    # Rest stuff\n    \"api.v1.avatar\",\n    \"api.v1._user\",\n]\n\nMIDDLEWARE = [\n    \"django.middleware.security.SecurityMiddleware\",\n    \"whitenoise.middleware.WhiteNoiseMiddleware\",\n    \"django.contrib.sessions.middleware.SessionMiddleware\",\n    \"corsheaders.middleware.CorsMiddleware\",\n    \"django.middleware.common.CommonMiddleware\",\n    \"django.middleware.csrf.CsrfViewMiddleware\",\n    \"django.contrib.auth.middleware.AuthenticationMiddleware\",\n    \"django.contrib.messages.middleware.MessageMiddleware\",\n    \"django.middleware.clickjacking.XFrameOptionsMiddleware\",\n]\n\nROOT_URLCONF = \"core.urls\"\n\nTEMPLATES = [\n    {\n        \"BACKEND\": \"django.template.backends.django.DjangoTemplates\",\n        \"DIRS\": [BASE_DIR / \"templates\"],\n        \"APP_DIRS\": True,\n        \"OPTIONS\": {\n            \"context_processors\": [\n                \"django.template.context_processors.debug\",\n                \"django.template.context_processors.request\",\n                \"django.contrib.auth.context_processors.auth\",\n                \"django.contrib.messages.context_processors.messages\",\n            ],\n        },\n    },\n]\n\nWSGI_APPLICATION = \"core.wsgi.application\"\n\n\n# Database\n# https://docs.djangoproject.com/en/3.2/ref/settings/#databases\n\nDATABASES = {\n    \"default\": {\n        \"ENGINE\": \"django.db.backends.sqlite3\",\n        \"NAME\": BASE_DIR / \"db.sqlite3\",\n    }\n}\n\n\n# Password validation\n# https://docs.djangoproject.com/en/3.2/ref/settings/#auth-password-validators\n\nAUTH_PASSWORD_VALIDATORS = [\n    {\n        \"NAME\": \"django.contrib.auth.password_validation.UserAttributeSimilarityValidator\",\n    },\n    {\n        \"NAME\": \"django.contrib.auth.password_validation.MinimumLengthValidator\",\n    },\n    {\n        \"NAME\": \"django.contrib.auth.password_validation.CommonPasswordValidator\",\n    },\n    {\n        \"NAME\": \"django.contrib.auth.password_validation.NumericPasswordValidator\",\n    },\n]\n\n# Custom user model\n# https://testdriven.io/blog/django-custom-user-model/\n\nAUTH_USER_MODEL = \"user.CustomUser\"\n\n# Password hashers\n# https://docs.djangoproject.com/en/3.2/topics/auth/passwords/#using-argon2-with-django\n\nPASSWORD_HASHERS = [\n    \"django.contrib.auth.hashers.Argon2PasswordHasher\",\n    \"django.contrib.auth.hashers.PBKDF2PasswordHasher\",\n    \"django.contrib.auth.hashers.PBKDF2SHA1PasswordHasher\",\n    \"django.contrib.auth.hashers.BCryptSHA256PasswordHasher\",\n]\n\n# Internationalization\n# https://docs.djangoproject.com/en/3.2/topics/i18n/\n\nLANGUAGE_CODE = \"en-us\"\n\nTIME_ZONE = \"UTC\"\n\nUSE_I18N = True\n\nUSE_L10N = True\n\nUSE_TZ = True\n\n\n# Static files (CSS, JavaScript, Images)\n# https://docs.djangoproject.com/en/3.2/howto/static-files/\nSTATIC_URL = \"/static/\"\n\nSTATICFILES_DIRS = [\n    os.path.join(BASE_DIR, \"static\"),\n]\n\nSTATIC_ROOT = os.path.join(BASE_DIR, \"staticfiles\")\nSTATICFILES_STORAGE = \"whitenoise.storage.CompressedManifestStaticFilesStorage\"\n\nMEDIA_URL = \"/media/\"\nMEDIA_ROOT = os.path.join(BASE_DIR, \"media\")\n# Default primary key field type\n# https://docs.djangoproject.com/en/3.2/ref/settings/#default-auto-field\n\nDEFAULT_AUTO_FIELD = \"django.db.models.BigAutoField\"\n\n# Rest framework auth\n# https://django-rest-framework-simplejwt.readthedocs.io/en/latest/getting_started.html#installation\nREST_FRAMEWORK = {\n    \"DEFAULT_AUTHENTICATION_CLASSES\": (\n        \"rest_framework.authentication.BasicAuthentication\",\n        \"rest_framework.authentication.SessionAuthentication\",\n    )\n}\n\n# Override the login url\n# https://stackoverflow.com/questions/49532708/custom-login-url-in-django#49532812\nLOGIN_URL = \"login_page\"\n\n\nCORS_ALLOWED_ORIGINS = [\n    \"http://127.0.0.1:3000\",\n    \"http://127.0.0.1:8000\",\n    \"http://localhost:3000\",\n    \"http://localhost:8000\",\n]\n", "path": "backend/core/settings.py"}], "after_files": [{"content": "\"\"\"core URL Configuration\n\nThe `urlpatterns` list routes URLs to views. For more information please see:\n    https://docs.djangoproject.com/en/3.2/topics/http/urls/\nExamples:\nFunction views\n    1. Add an import:  from my_app import views\n    2. Add a URL to urlpatterns:  path('', views.home, name='home')\nClass-based views\n    1. Add an import:  from other_app.views import Home\n    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')\nIncluding another URLconf\n    1. Import the include() function: from django.urls import include, path\n    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))\n\"\"\"\nfrom django.contrib import admin\nfrom django.urls import path\nfrom django.urls import include\nfrom django.conf.urls.static import static\nfrom django.conf import settings\n\nfrom rest_framework_simplejwt.views import (\n    TokenObtainPairView,\n    TokenRefreshView,\n    TokenBlacklistView,\n)\n\nurlpatterns = [\n    path(\"admin/\", admin.site.urls),\n    # Pages\n    path(\"user/\", include(\"pages.users.urls\")),\n    path(\"authentication/\", include(\"pages.authentication.urls\")),\n    # Api\n    path(\"api/v1/avatar/\", include(\"api.v1.avatar.urls\")),\n    # https://django-rest-framework-simplejwt.readthedocs.io/en/latest/getting_started.html#installation\n    path(\"api/v1/token/\", TokenObtainPairView.as_view(), name=\"token_obtain_pair\"),\n    path(\"api/v1/token/refresh/\", TokenRefreshView.as_view(), name=\"token_refresh\"),\n    path(\n        \"api/v1/token/blacklist/\", TokenBlacklistView.as_view(), name=\"token_blacklist\"\n    ),\n    # Rest endpoints\n    path(\"api/v1/users/\", include(\"api.v1._user.urls\")),\n]\nif settings.DEBUG:\n    urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)\n    urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)\n", "path": "backend/core/urls.py"}, {"content": "\"\"\"\nDjango settings for core project.\n\nGenerated by 'django-admin startproject' using Django 3.2.7.\n\nFor more information on this file, see\nhttps://docs.djangoproject.com/en/3.2/topics/settings/\n\nFor the full list of settings and their values, see\nhttps://docs.djangoproject.com/en/3.2/ref/settings/\n\"\"\"\n\nfrom pathlib import Path\nimport os\n\n# Build paths inside the project like this: BASE_DIR / 'subdir'.\nBASE_DIR = Path(__file__).resolve().parent.parent\n\n\n# Quick-start development settings - unsuitable for production\n# See https://docs.djangoproject.com/en/3.2/howto/deployment/checklist/\n\n# SECURITY WARNING: keep the secret key used in production secret!\nSECRET_KEY = \"django-insecure-mn19l@e%r^s&a^pa9%(bf173v-0c54^@3s(pb!ts_yuts0$+6p\"\n\n# SECURITY WARNING: don't run with debug turned on in production!\nDEBUG = True\n\nALLOWED_HOSTS = []\n\n\n# Application definition\n\nINSTALLED_APPS = [\n    \"django.contrib.admin\",\n    \"django.contrib.auth\",\n    \"django.contrib.contenttypes\",\n    \"django.contrib.sessions\",\n    \"django.contrib.messages\",\n    \"whitenoise.runserver_nostatic\",\n    \"django.contrib.staticfiles\",\n    # Rest Framework\n    \"rest_framework\",\n    \"rest_framework_simplejwt.token_blacklist\",\n    # 3rd party stuff\n    \"corsheaders\",\n    # Custom Stuff\n    \"custom.user\",\n    # Pages\n    \"pages.users\",\n    \"pages.authentication\",\n    # Rest stuff\n    \"api.v1.avatar\",\n    \"api.v1._user\",\n]\n\nMIDDLEWARE = [\n    \"django.middleware.security.SecurityMiddleware\",\n    \"whitenoise.middleware.WhiteNoiseMiddleware\",\n    \"django.contrib.sessions.middleware.SessionMiddleware\",\n    \"corsheaders.middleware.CorsMiddleware\",\n    \"django.middleware.common.CommonMiddleware\",\n    \"django.middleware.csrf.CsrfViewMiddleware\",\n    \"django.contrib.auth.middleware.AuthenticationMiddleware\",\n    \"django.contrib.messages.middleware.MessageMiddleware\",\n    \"django.middleware.clickjacking.XFrameOptionsMiddleware\",\n]\n\nROOT_URLCONF = \"core.urls\"\n\nTEMPLATES = [\n    {\n        \"BACKEND\": \"django.template.backends.django.DjangoTemplates\",\n        \"DIRS\": [BASE_DIR / \"templates\"],\n        \"APP_DIRS\": True,\n        \"OPTIONS\": {\n            \"context_processors\": [\n                \"django.template.context_processors.debug\",\n                \"django.template.context_processors.request\",\n                \"django.contrib.auth.context_processors.auth\",\n                \"django.contrib.messages.context_processors.messages\",\n            ],\n        },\n    },\n]\n\nWSGI_APPLICATION = \"core.wsgi.application\"\n\n\n# Database\n# https://docs.djangoproject.com/en/3.2/ref/settings/#databases\n\nDATABASES = {\n    \"default\": {\n        \"ENGINE\": \"django.db.backends.sqlite3\",\n        \"NAME\": BASE_DIR / \"db.sqlite3\",\n    }\n}\n\n\n# Password validation\n# https://docs.djangoproject.com/en/3.2/ref/settings/#auth-password-validators\n\nAUTH_PASSWORD_VALIDATORS = [\n    {\n        \"NAME\": \"django.contrib.auth.password_validation.UserAttributeSimilarityValidator\",\n    },\n    {\n        \"NAME\": \"django.contrib.auth.password_validation.MinimumLengthValidator\",\n    },\n    {\n        \"NAME\": \"django.contrib.auth.password_validation.CommonPasswordValidator\",\n    },\n    {\n        \"NAME\": \"django.contrib.auth.password_validation.NumericPasswordValidator\",\n    },\n]\n\n# Custom user model\n# https://testdriven.io/blog/django-custom-user-model/\n\nAUTH_USER_MODEL = \"user.CustomUser\"\n\n# Password hashers\n# https://docs.djangoproject.com/en/3.2/topics/auth/passwords/#using-argon2-with-django\n\nPASSWORD_HASHERS = [\n    \"django.contrib.auth.hashers.Argon2PasswordHasher\",\n    \"django.contrib.auth.hashers.PBKDF2PasswordHasher\",\n    \"django.contrib.auth.hashers.PBKDF2SHA1PasswordHasher\",\n    \"django.contrib.auth.hashers.BCryptSHA256PasswordHasher\",\n]\n\n# Internationalization\n# https://docs.djangoproject.com/en/3.2/topics/i18n/\n\nLANGUAGE_CODE = \"en-us\"\n\nTIME_ZONE = \"UTC\"\n\nUSE_I18N = True\n\nUSE_L10N = True\n\nUSE_TZ = True\n\n\n# Static files (CSS, JavaScript, Images)\n# https://docs.djangoproject.com/en/3.2/howto/static-files/\nSTATIC_URL = \"/static/\"\n\nSTATICFILES_DIRS = [\n    os.path.join(BASE_DIR, \"static\"),\n]\n\nSTATIC_ROOT = os.path.join(BASE_DIR, \"staticfiles\")\nSTATICFILES_STORAGE = \"whitenoise.storage.CompressedManifestStaticFilesStorage\"\n\nMEDIA_URL = \"/media/\"\nMEDIA_ROOT = os.path.join(BASE_DIR, \"media\")\n# Default primary key field type\n# https://docs.djangoproject.com/en/3.2/ref/settings/#default-auto-field\n\nDEFAULT_AUTO_FIELD = \"django.db.models.BigAutoField\"\n\n# Rest framework auth\n# https://django-rest-framework-simplejwt.readthedocs.io/en/latest/getting_started.html#installation\nREST_FRAMEWORK = {\n    \"DEFAULT_AUTHENTICATION_CLASSES\": (\n        \"rest_framework_simplejwt.authentication.JWTAuthentication\",\n        \"rest_framework.authentication.BasicAuthentication\",\n        \"rest_framework.authentication.SessionAuthentication\",\n    )\n}\n\n# Override the login url\n# https://stackoverflow.com/questions/49532708/custom-login-url-in-django#49532812\nLOGIN_URL = \"login_page\"\n\n\nCORS_ALLOWED_ORIGINS = [\n    \"http://127.0.0.1:3000\",\n    \"http://127.0.0.1:8000\",\n    \"http://localhost:3000\",\n    \"http://localhost:8000\",\n]\n", "path": "backend/core/settings.py"}]}