substitui valores por variáveis de ambiente

This commit is contained in:
2025-06-30 13:23:03 -04:00
parent 28b12c5ab9
commit 6e8e24caeb
2 changed files with 7 additions and 7 deletions

View File

@ -19,7 +19,7 @@ if READ_DOT_ENV_FILE:
# GENERAL # GENERAL
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
# https://docs.djangoproject.com/en/dev/ref/settings/#debug # https://docs.djangoproject.com/en/dev/ref/settings/#debug
DEBUG = env.bool("DJANGO_DEBUG", False) DEBUG = env.bool("DJANGO_DEBUG", True)
# Local time zone. Choices are # Local time zone. Choices are
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
# though not all of them may be available with every OS. # though not all of them may be available with every OS.
@ -177,6 +177,7 @@ TEMPLATES = [
"APP_DIRS": True, "APP_DIRS": True,
"OPTIONS": { "OPTIONS": {
# https://docs.djangoproject.com/en/dev/ref/settings/#template-context-processors # https://docs.djangoproject.com/en/dev/ref/settings/#template-context-processors
"string_if_invalid": "INVALID_TEMPLATE_VAR",
"context_processors": [ "context_processors": [
"django.template.context_processors.debug", "django.template.context_processors.debug",
"django.template.context_processors.request", "django.template.context_processors.request",
@ -210,10 +211,7 @@ FIXTURE_DIRS = (str(APPS_DIR / "fixtures"),)
SESSION_COOKIE_HTTPONLY = True SESSION_COOKIE_HTTPONLY = True
# https://docs.djangoproject.com/en/dev/ref/settings/#csrf-cookie-httponly # https://docs.djangoproject.com/en/dev/ref/settings/#csrf-cookie-httponly
CSRF_COOKIE_HTTPONLY = True CSRF_COOKIE_HTTPONLY = True
CSRF_TRUSTED_ORIGINS = [ CSRF_TRUSTED_ORIGINS = env.list("DJANGO_CSRF_TRUSTED_ORIGINS")
'http://localhost',
'http://192.168.235.234',
]
# https://docs.djangoproject.com/en/dev/ref/settings/#x-frame-options # https://docs.djangoproject.com/en/dev/ref/settings/#x-frame-options
X_FRAME_OPTIONS = "DENY" X_FRAME_OPTIONS = "DENY"
@ -298,7 +296,7 @@ ELASTICSEARCH_PASSWORD = env.str("ELASTICSEARCH_PASSWORD")
ELASTICSEARCH_DSL = { ELASTICSEARCH_DSL = {
"default": { "default": {
"hosts": "http://elasticsearch:9200", "hosts": "http://elasticsearch:9200",
"timeout": 60, "timeout": 600,
"http_auth": ( "http_auth": (
ELASTICSEARCH_USER, ELASTICSEARCH_USER,
ELASTICSEARCH_PASSWORD, ELASTICSEARCH_PASSWORD,
@ -347,3 +345,5 @@ ELASTICSEARCH_INDEX_SETTINGS = {
}, },
}, },
} }
API_BASE_URL = env.str("DJANGO_API_BASE_URL")

View File

@ -13,7 +13,7 @@ SECRET_KEY = env(
"DJANGO_SECRET_KEY", "DJANGO_SECRET_KEY",
) )
# https://docs.djangoproject.com/en/dev/ref/settings/#allowed-hosts # https://docs.djangoproject.com/en/dev/ref/settings/#allowed-hosts
ALLOWED_HOSTS = ["localhost", "0.0.0.0", "127.0.0.1", "192.168.235.234"] # noqa: S104 ALLOWED_HOSTS = env.list("DJANGO_ALLOWED_HOSTS")
# CACHES # CACHES
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------