From a76d77bdf29d0b848c841a590e909b78247267f4 Mon Sep 17 00:00:00 2001 From: Adrian Ciolek Date: Wed, 24 Apr 2024 01:53:20 +0200 Subject: [PATCH] possible fix cors problem --- pyproject.toml | 2 +- src/cs2_battle_bot/settings.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 6205158..9809f4f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "cs2-battle-bot-api" -version = "0.0.29" +version = "0.0.30" description = "" authors = ["Adrian Ciolek "] readme = "README.md" diff --git a/src/cs2_battle_bot/settings.py b/src/cs2_battle_bot/settings.py index 5d92563..7bfaf2a 100644 --- a/src/cs2_battle_bot/settings.py +++ b/src/cs2_battle_bot/settings.py @@ -30,9 +30,9 @@ # SECURITY WARNING: don't run with debug turned on in production! DEBUG = os.environ.get("DEBUG", "True") == "True" -ALLOWED_HOSTS = os.environ.get("ALLOWED_HOSTS", "*").split(",") +ALLOWED_HOSTS = os.environ.get("ALLOWED_HOSTS", ["*"]).split(",") CORS_ALLOWED_ORIGINS = os.environ.get("CORS_ALLOWED_ORIGINS", "http://localhost:8002").split(",") -CORS_ALLOW_ALL_ORIGINS = os.environ.get("CORS_ALLOW_ALL_ORIGINS", False) +CORS_ALLOW_ALL_ORIGINS = os.environ.get("CORS_ALLOW_ALL_ORIGINS", True) CSRF_TRUSTED_ORIGINS = os.environ.get( "CSRF_TRUSTED_ORIGINS", "http://localhost:8002" ).split(",") @@ -90,9 +90,9 @@ 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",