Update settings.py
Add deprecation notice for `CORS_ORIGIN_ALLOW_ALL` and auto switch to `CORS_ALLOW_ALL_ORIGINS`
This commit is contained in:
parent
ce29283a52
commit
e2f8efb521
@ -68,7 +68,11 @@ ALLOWED_HOSTS = os.getenv('ALLOWED_HOSTS').split(
|
||||
if os.getenv('CSRF_TRUSTED_ORIGINS'):
|
||||
CSRF_TRUSTED_ORIGINS = os.getenv('CSRF_TRUSTED_ORIGINS').split(',')
|
||||
|
||||
CORS_ORIGIN_ALLOW_ALL = True
|
||||
if CORS_ORIGIN_ALLOW_ALL := os.getenv('CORS_ORIGIN_ALLOW_ALL') is not None:
|
||||
print('DEPRECATION WARNING: Environment var "CORS_ORIGIN_ALLOW_ALL" is deprecated. Please use "CORS_ALLOW_ALL_ORIGINS."')
|
||||
CORS_ALLOW_ALL_ORIGINS = CORS_ORIGIN_ALLOW_ALL
|
||||
else:
|
||||
CORS_ALLOW_ALL_ORIGINS = bool(int(os.getenv("CORS_ALLOW_ALL_ORIGINS", True)))
|
||||
|
||||
LOGIN_REDIRECT_URL = "index"
|
||||
LOGOUT_REDIRECT_URL = "index"
|
||||
|
Loading…
Reference in New Issue
Block a user