feat: configure ALLOWED_HOSTS dynamically via environment variables in settings and docker-compose

This commit is contained in:
2026-04-05 12:29:30 -03:00
parent df83dac830
commit dfe0894305
2 changed files with 3 additions and 1 deletions

View File

@@ -10,7 +10,7 @@ services:
environment: environment:
- DEBUG=True - DEBUG=True
- ALLOWED_HOSTS=* - ALLOWED_HOSTS=raulrockbar.com.br,api.raulrockbar.com.br
- CSRF_TRUSTED_ORIGINS=https://raulrockbar.com.br,https://api.raulrockbar.com.br - CSRF_TRUSTED_ORIGINS=https://raulrockbar.com.br,https://api.raulrockbar.com.br
volumes: volumes:

View File

@@ -36,6 +36,8 @@ SECRET_KEY = os.getenv(
"SECRET_KEY", "django-insecure-mqcnrs5!hc6bj$&#0@@9d8^2@x#w&$qhk3vlr5_)3znd9h6&d8" "SECRET_KEY", "django-insecure-mqcnrs5!hc6bj$&#0@@9d8^2@x#w&$qhk3vlr5_)3znd9h6&d8"
) )
ALLOWED_HOSTS = os.getenv("ALLOWED_HOSTS", "*").split(",")
# SECURITY WARNING: don't run with debug turned on in production! # SECURITY WARNING: don't run with debug turned on in production!
DEBUG = os.getenv("DEBUG", "True") == "True" DEBUG = os.getenv("DEBUG", "True") == "True"