From 0de19a70d8c8f488a7559014db3dfb87822b6040 Mon Sep 17 00:00:00 2001 From: Ivlev Denis Date: Wed, 25 Apr 2018 12:40:59 +0300 Subject: [PATCH] Add CORS_ORIGIN_WHITELIST --- .env.example | 1 + project/settings.py | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/.env.example b/.env.example index 12887dd3..7d620618 100644 --- a/.env.example +++ b/.env.example @@ -1,6 +1,7 @@ # DEBUG=True ALLOWED_HOSTS=* PORT=8000 +CORS_ORIGIN_WHITELIST=lilcity.9ev.ru:8080 LANG=ru_RU.UTF-8 POSTGRES_DB=lilcity POSTGRES_USER=lilcity diff --git a/project/settings.py b/project/settings.py index 9513b463..dc22d5cf 100644 --- a/project/settings.py +++ b/project/settings.py @@ -239,6 +239,10 @@ MIX_TOKEN = os.getenv('MIXPANEL_TOKEN', '79bd6bfd98667ed977737e6810b8abcd') if DEBUG: CORS_ORIGIN_ALLOW_ALL = True +else: + CORS_ORIGIN_WHITELIST = os.getenv('CORS_ORIGIN_WHITELIST').split(',') or ( + 'lilcity.9ev.ru:8080', + ) # Swagger doc settings