diff --git a/server/server/settings/base.py b/server/server/settings/base.py index 7b41f79..58ef714 100644 --- a/server/server/settings/base.py +++ b/server/server/settings/base.py @@ -32,15 +32,16 @@ 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', + 'corsheaders', 'colorfield', 'works', 'storages', - 'corsheaders', 'rest_framework' ] MIDDLEWARE = [ 'django.middleware.security.SecurityMiddleware', + 'corsheaders.middleware.CorsMiddleware', 'whitenoise.middleware.WhiteNoiseMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', @@ -127,6 +128,11 @@ }, ] +CORS_ALLOWED_ORIGINS = [ + 'https://shared-vps.compositecomputer.club', + 'http://localhost:3000' +] + # Internationalization # https://docs.djangoproject.com/en/3.0/topics/i18n/ @@ -151,8 +157,4 @@ STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage' MEDIA_ROOT = os.path.join(BASE_DIR, "media") -MEDIA_URL = '/media/' - -CORS_ALLOWED_ORIGINS = [ - 'http://*' -] \ No newline at end of file +MEDIA_URL = '/media/' \ No newline at end of file diff --git a/server/server/settings/development.py b/server/server/settings/development.py index 446efa1..167c356 100644 --- a/server/server/settings/development.py +++ b/server/server/settings/development.py @@ -21,6 +21,7 @@ ALLOWED_HOSTS = ["*"] +CORS_ALLOW_ALL_ORIGINS = True # Database # https://docs.djangoproject.com/en/3.0/ref/settings/#databases