feat: added improvements from django-htmx-template
CI / test (push) Successful in 1m2s
CI / build (push) Successful in 50s

This commit is contained in:
2026-09-21 14:27:17 +02:00
parent e76b4b7a9c
commit 5fe349d617
12 changed files with 106 additions and 34 deletions
+8 -2
View File
@@ -12,11 +12,17 @@ env_file = BASE_DIR / '.env'
if os.path.exists(env_file):
environ.Env.read_env(env_file)
SECRET_KEY = env.str('SECRET_KEY', 'this-is-the-default-secret-key')
SECRET_KEY = env.str('SECRET_KEY')
DEBUG = env.bool('DEBUG', False)
CORS_ORIGIN_WHITELIST = env.str('CORS_ORIGIN_WHITELIST', 'http://localhost:8000').split(',')
CSRF_TRUSTED_ORIGINS = env.str('CSRF_TRUSTED_ORIGINS', 'http://localhost:8000').split(',')
# La cookie CSRF solo hace falta leerla desde JS en sitios que la mandan a
# mano en una cabecera (fetch/XHR); aquí no la lee ningún script (los POST
# de HTMX/fetch usan el token embebido en el HTML vía csrf_token, ver
# account_settings.html/csrf.js), así que no hay motivo para exponerla al
# DOM y sí para quitarle esa superficie a un XSS.
CSRF_COOKIE_HTTPONLY = True
DATABASE_URL = env.db_url('DATABASE_URL', 'sqlite:///db.sqlite3')
@@ -24,7 +30,7 @@ REDIS_HOST = env.str('REDIS_HOST', 'redis')
REDIS_PORT = env.str('REDIS_PORT', 6379)
PAGE_SIZE = env.int('PAGE_SIZE', 20)
ALLOWED_HOSTS = env.str('ALLOWED_HOSTS', '*').split(',')
ALLOWED_HOSTS = env.str('ALLOWED_HOSTS').split(',')
CELERY_BROKER_URL = env.str('CELERY_BROKER_URL', 'redis://172.17.0.1:6379/0')