Fixes: settings data types

This commit is contained in:
Egor Pavlovich Gorbunov 2025-06-11 11:23:54 +03:00
parent e39d13f651
commit 52ea4c3212

View file

@ -27,6 +27,8 @@ else:
for entry in getenv("ALLOWED_HOSTS").split(" "): for entry in getenv("ALLOWED_HOSTS").split(" "):
ALLOWED_HOSTS.add(entry) ALLOWED_HOSTS.add(entry)
ALLOWED_HOSTS = tuple(ALLOWED_HOSTS)
CSRF_TRUSTED_ORIGINS = { CSRF_TRUSTED_ORIGINS = {
"http://127.0.0.1", "http://127.0.0.1",
"http://api.localhost", "http://api.localhost",
@ -36,6 +38,8 @@ CSRF_TRUSTED_ORIGINS = {
for entry in getenv("CSRF_TRUSTED_ORIGINS").split(" "): for entry in getenv("CSRF_TRUSTED_ORIGINS").split(" "):
CSRF_TRUSTED_ORIGINS.add(entry) CSRF_TRUSTED_ORIGINS.add(entry)
CSRF_TRUSTED_ORIGINS = tuple(CSRF_TRUSTED_ORIGINS)
if DEBUG: if DEBUG:
CORS_ALLOW_ALL_ORIGINS = True CORS_ALLOW_ALL_ORIGINS = True
else: else:
@ -47,6 +51,8 @@ else:
for entry in getenv("CORS_ALLOWED_ORIGINS").split(" "): for entry in getenv("CORS_ALLOWED_ORIGINS").split(" "):
CORS_ALLOWED_ORIGINS.add(entry) CORS_ALLOWED_ORIGINS.add(entry)
CORS_ALLOWED_ORIGINS = tuple(CORS_ALLOWED_ORIGINS)
CORS_ALLOW_METHODS = ( CORS_ALLOW_METHODS = (
"DELETE", "DELETE",
"GET", "GET",
@ -56,7 +62,7 @@ else:
"PUT", "PUT",
) )
CORS_ALLOW_HEADERS = [ CORS_ALLOW_HEADERS = (
"accept", "accept",
"accept-encoding", "accept-encoding",
"accept-language", "accept-language",
@ -77,7 +83,7 @@ CORS_ALLOW_HEADERS = [
"sec-gpc", "sec-gpc",
"origin", "origin",
"referer", "referer",
] )
USE_X_FORWARDED_HOST = True USE_X_FORWARDED_HOST = True
SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTO", "https") if not DEBUG else None SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTO", "https") if not DEBUG else None