diff --git a/pyswiss/core/settings.py b/pyswiss/core/settings.py index 2b0cda4..dc077ef 100644 --- a/pyswiss/core/settings.py +++ b/pyswiss/core/settings.py @@ -8,11 +8,22 @@ DEBUG = os.environ.get('DEBUG', 'true').lower() != 'false' ALLOWED_HOSTS = os.environ.get('ALLOWED_HOSTS', '*').split(',') INSTALLED_APPS = [ + 'corsheaders', 'django.contrib.contenttypes', 'django.contrib.auth', 'apps.charts', ] +MIDDLEWARE = [ + 'corsheaders.middleware.CorsMiddleware', + 'django.middleware.common.CommonMiddleware', +] + +CORS_ALLOWED_ORIGIN_REGEXES = [ + r'^https://.*\.earthmanrpg\.me$', + r'^http://localhost(:\d+)?$', +] + ROOT_URLCONF = 'core.urls' DATABASES = { diff --git a/pyswiss/requirements.txt b/pyswiss/requirements.txt index 8c784d9..68a2dc4 100644 --- a/pyswiss/requirements.txt +++ b/pyswiss/requirements.txt @@ -1,3 +1,4 @@ django==6.0.4 +django-cors-headers==4.3.1 gunicorn==23.0.0 pyswisseph==2.10.3.2