Update infra

This commit is contained in:
2023-01-05 21:56:57 +01:00
parent 2807c5e00e
commit e6b5804e37
7 changed files with 390 additions and 23 deletions

View File

@ -25,7 +25,7 @@ BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = "django-insecure-x0_t$gei=_o_p(%%!-db$jezka@y+d67$a8tvw13nl^8$l*t@="
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
DEBUG = False if os.environ.get("PROD") else True
ALLOWED_HOSTS = ["*"]
@ -42,6 +42,9 @@ INSTALLED_APPS = [
"django.contrib.staticfiles",
]
if DEBUG:
INSTALLED_APPS.append("django_extensions")
MIDDLEWARE = [
"django.middleware.security.SecurityMiddleware",
"django.contrib.sessions.middleware.SessionMiddleware",
@ -109,7 +112,7 @@ AUTH_PASSWORD_VALIDATORS = [
LANGUAGE_CODE = "en-us"
TIME_ZONE = os.environ.get("TZ", "UTC")
TIME_ZONE = "Europe/Prague" if DEBUG else os.environ.get("TZ", "UTC")
USE_I18N = True
@ -134,4 +137,7 @@ LOGGING = {
"root": {"handlers": ["console"], "level": "WARNING"},
}
CSRF_TRUSTED_ORIGINS = ["https://tracker.kucharczyk.xyz"]
CSRF_TRUSTED_ORIGINS = [""]
if os.environ.get("PROD"):
CSRF_TRUSTED_ORIGINS.append(os.environ.get("CSRF_TRUSTED_ORIGINS"))