Add CORS headers and update installed apps in settings.py
This commit is contained in:
parent
00407ea767
commit
d9cdada41f
2 changed files with 9 additions and 2 deletions
|
@ -1,3 +1,3 @@
|
|||
from django.shortcuts import render
|
||||
|
||||
# Create your views here.
|
||||
# Create your views here.
|
|
@ -41,11 +41,13 @@ INSTALLED_APPS = [
|
|||
'django.contrib.sessions',
|
||||
'django.contrib.messages',
|
||||
'django.contrib.staticfiles',
|
||||
'api',
|
||||
'rest_framework',
|
||||
'corsheaders',
|
||||
'api',
|
||||
]
|
||||
|
||||
MIDDLEWARE = [
|
||||
'corsheaders.middleware.CorsMiddleware',
|
||||
'django.middleware.security.SecurityMiddleware',
|
||||
'django.contrib.sessions.middleware.SessionMiddleware',
|
||||
'django.middleware.common.CommonMiddleware',
|
||||
|
@ -133,3 +135,8 @@ MEDIA_ROOT = os.path.join(BASE_DIR, 'media/')
|
|||
# https://docs.djangoproject.com/en/5.0/ref/settings/#default-auto-field
|
||||
|
||||
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
|
||||
|
||||
CORS_ORIGIN_WHITELIST = [
|
||||
"http://localhost:5173",
|
||||
"http://localhost:5174"
|
||||
]
|
||||
|
|
Loading…
Reference in a new issue