Skip to content

Commit 109fd49

Browse files
committed
read cors allowed from env
1 parent 4da1178 commit 109fd49

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

config/settings/local.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@
6161
# django-cors-headers - https://github.com/adamchainz/django-cors-headers#setup
6262
# Your stuff...
6363
# CORS_ALLOW_ALL_ORIGINS = True
64-
CORS_ALLOWED_ORIGIN_REGEXES = [
65-
r"^http://localhost:3000$", # works for local dev
66-
]
64+
CORS_ALLOWED_ORIGIN_REGEXES = [r'{}'.format(s) for s in env.list("CORS_ALLOWED_ORIGIN_REGEXES", default=[r"^http://localhost:3000$"])]
65+
# CORS_ALLOWED_ORIGIN_REGEXES = [
66+
# r"^http://localhost:3000$", # works for local dev
67+
# ]
68+
print('CORS_ALLOWED_ORIGIN_REGEXES', CORS_ALLOWED_ORIGIN_REGEXES)
6769
# ------------------------------------------------------------------------------

0 commit comments

Comments
 (0)