Browse Source

try to fix cors

ilya_shyian 2 years ago
parent
commit
dfcb9b48d9
1 changed files with 3 additions and 3 deletions
  1. 3 3
      store_back/settings.py

+ 3 - 3
store_back/settings.py

@@ -67,9 +67,9 @@ INSTALLED_APPS = [
 ]
 
 MIDDLEWARE = [
+    'corsheaders.middleware.CorsMiddleware',
     'django.middleware.security.SecurityMiddleware',
     'django.contrib.sessions.middleware.SessionMiddleware',
-    'corsheaders.middleware.CorsMiddleware',
     'django.middleware.common.CommonMiddleware',
     # 'django.middleware.csrf.CsrfViewMiddleware',
     'django.contrib.auth.middleware.AuthenticationMiddleware',
@@ -152,10 +152,10 @@ DATABASES = {
 # https://docs.djangoproject.com/en/4.0/howto/static-files/
 
 STATIC_ROOT = os.path.join(BASE_DIR, 'static')
-STATIC_URL = 'api/static/'
+STATIC_URL = '/api/static/'
 
 MEDIA_ROOT = os.path.join(BASE_DIR, 'media').replace('\\', '/')
-MEDIA_URL = 'api/media/'
+MEDIA_URL = '/api/media/'
 
 
 # Default primary key field type