modified cord allowed origin values, added yml file for qa stage and prod

This commit is contained in:
abutalib-kiwi
2023-09-04 16:45:29 +05:30
parent 6c96ea0820
commit be9f600bcc
4 changed files with 128 additions and 2 deletions

View File

@ -35,19 +35,28 @@ BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = os.getenv('SECRET_KEY')
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = os.getenv('DEBUG')
ENV = os.getenv('ENV')
# cors allow setting
CORS_ORIGIN_ALLOW_ALL = False
# Allow specific origins
# if ENV in ['dev', 'qa', 'stage']:
CORS_ALLOWED_ORIGINS = [
# backend base url
"https://dev-api.zodqaapp.com",
"https://qa-api.zodqaapp.com",
"https://stage-api.zodqaapp.com",
# frontend url
"http://localhost:3000",
"https://zod-dev.zodqaapp.com",
"https://zod-qa.zodqaapp.com",
"https://zod-stage.zodqaapp.com",
# Add more trusted origins as needed
]
# if DEBUG:
# CORS_ALLOWED_ORIGINS += ["http://localhost:3000"]
if ENV == "prod":
CORS_ALLOWED_ORIGINS = []
# allow all host
ALLOWED_HOSTS = ['*']