Add Nginx configuration, update MEDIA_ROOT path, and enhance email confirmation task

This commit is contained in:
2026-03-20 09:17:01 +01:00
parent c6b3bca910
commit d6feeee893
4 changed files with 101 additions and 17 deletions
+14 -1
View File
@@ -212,7 +212,7 @@ if SASS_BINARY:
# Media files (User uploads)
MEDIA_URL = 'media/'
MEDIA_ROOT = BASE_DIR / 'tienda' / 'static' / 'media'
MEDIA_ROOT = Path(os.getenv('MEDIA_ROOT', '/app/media'))
# Redis Configuration
CACHES = {
@@ -271,6 +271,19 @@ AUTH_USER_MODEL = 'tienda.User'
DOMAIN = os.getenv("DOMAIN", "localhost")
PROTOCOL = os.getenv("PROTOCOL", "http")
default_csrf_trusted_origins = []
if DOMAIN:
default_csrf_trusted_origins.append(f"{PROTOCOL}://{DOMAIN}")
for host in ALLOWED_HOSTS:
if host and host != '*':
default_csrf_trusted_origins.append(f"{PROTOCOL}://{host}")
CSRF_TRUSTED_ORIGINS = env_list(
'CSRF_TRUSTED_ORIGINS',
list(dict.fromkeys(default_csrf_trusted_origins)),
)
LOG_LEVEL = os.getenv('LOG_LEVEL', 'INFO').upper()
LOG_DIR = Path(os.getenv('LOG_DIR', BASE_DIR / 'logs'))