Update CORS url in django settings to use an env var

This commit is contained in:
Dana Lambert 2021-11-10 17:20:26 +13:00
parent d65f48a387
commit a99f63898f

View file

@ -10,6 +10,7 @@ For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.2/ref/settings/
"""
import os
from pathlib import Path
# Build paths inside the project like this: BASE_DIR / 'subdir'.
@ -136,7 +137,7 @@ STATIC_URL = '/static/'
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
CORS_ALLOWED_ORIGINS = [
'http://localhost:3000' # Update this for production
os.getenv("FRONTEND_BASE_URL") or 'http://localhost:3000'
]
CORS_ALLOW_HEADERS = [