feat [api]: configure cors

This commit is contained in:
Alice 2022-04-03 01:20:55 +02:00
parent 409942d9c3
commit 603d498bae

View file

@ -138,3 +138,14 @@ REST_FRAMEWORK = {
"djangorestframework_camel_case.parser.CamelCaseJSONParser",
),
}
BASE_URL = "http://localhost:8000/"
FRONT_END_URL = "http://localhost:3000"
SESSION_COOKIE_SAMESITE = None
CORS_ALLOWED_ORIGINS = ["http://localhost:3000", "http://127.0.0.1:3000"]
CORS_ALLOW_CREDENTIALS = True
CORS_ORIGIN_WHITELIST = ("http://localhost:3000",)
CSRF_TRUSTED_ORIGINS = ["http://localhost:3000"]