diff --git a/steering/settings.py b/steering/settings.py index bbedf9d9ec39df40d716670b0bdffa7bbc3026dc..86b7c06e73d6a82f72fa902cf85501c58b3972e4 100644 --- a/steering/settings.py +++ b/steering/settings.py @@ -30,9 +30,15 @@ MANAGERS = ADMINS # Must be set if DEBUG is False ALLOWED_HOSTS = env.list("ALLOWED_HOSTS", default=["127.0.0.1", "localhost"]) -# Whitelist IPs that access the API -CORS_ORIGIN_WHITELIST = env.list( - "CORS_ORIGIN_WHITELIST", default=("http://localhost:8080", "http://localhost:8040") +# Whitelist origins that access the API +CORS_ALLOWED_ORIGINS = env.list( + "CORS_ALLOWED_ORIGINS", + default=env.list( + # This is for backwards compatibility as + # CORS_ALLOWED_ORIGINS was named CORS_ORIGIN_WHITELIST in the past. + "CORS_ORIGIN_WHITELIST", + default=("http://localhost:8080", "http://localhost:8040"), + ), ) CORS_ALLOW_CREDENTIALS = True CORS_ALLOW_HEADERS = list(default_headers) + [