diff options
| author | Bobby <[email protected]> | 2023-07-21 18:10:26 -0400 |
|---|---|---|
| committer | Bobby <[email protected]> | 2023-07-21 18:10:26 -0400 |
| commit | 17a02ecdbc79b7ac545234b4c5e8ad31b049be18 (patch) | |
| tree | d256f6ab8dc9d53ac8d5e684994eb6fab38670f8 | |
| parent | 55a19d8ef934ecdbf6fc7b7a8f302e6356247a58 (diff) | |
| download | thatcomputerscientist-17a02ecdbc79b7ac545234b4c5e8ad31b049be18.tar.xz thatcomputerscientist-17a02ecdbc79b7ac545234b4c5e8ad31b049be18.zip | |
Added CORS
| -rw-r--r-- | thatcomputerscientist/settings.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/thatcomputerscientist/settings.py b/thatcomputerscientist/settings.py index 4636ee0b..392dd0ab 100644 --- a/thatcomputerscientist/settings.py +++ b/thatcomputerscientist/settings.py @@ -38,6 +38,7 @@ DEBUG = True if os.getenv('ENVIRONMENT') == 'development' else False ALLOWED_HOSTS = ["*"] CSRF_TRUSTED_ORIGINS = ['https://*.thatcomputerscientist.com', 'http://*.thatcomputerscientist.com', 'https://*.shi.foo'] +CORS_ALLOWED_ORIGINS = ['https://*.thatcomputerscientist.com', 'http://*.thatcomputerscientist.com', 'https://*.shi.foo'] DOMAIN_NAME = "shi.foo" SESSION_COOKIE_DOMAIN = os.getenv('DOMAIN') if os.getenv('ENVIRONMENT') == 'development' else ".shi.foo" SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https') @@ -60,6 +61,7 @@ INSTALLED_APPS = [ 'django.contrib.sitemaps', 'sslserver', 'rest_framework', + 'corsheaders', 'thatcomputerscientist', 'haystack', 'django_hosts', @@ -100,6 +102,7 @@ MIDDLEWARE = [ 'whitenoise.middleware.WhiteNoiseMiddleware', 'middleware.oldbrowsermiddleware.OldBrowserMiddleware', 'middleware.globalmetamiddleware.GlobalMetaMiddleware', + 'corsheaders.middleware.CorsMiddleware', 'middleware.uuidmiddleware.UserUUIDMiddleware', 'django_hosts.middleware.HostsResponseMiddleware' ] |
