From 99e1198819709dbdb2ba87ecab68c6b6a64e4ac9 Mon Sep 17 00:00:00 2001 From: Mono Mono Date: Sat, 8 Feb 2025 18:54:54 -0500 Subject: [PATCH] allowed settings from environment. --- tienda_ilusion/tienda_ilusion/settings.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/tienda_ilusion/tienda_ilusion/settings.py b/tienda_ilusion/tienda_ilusion/settings.py index 8ba68ec..a48f9c4 100644 --- a/tienda_ilusion/tienda_ilusion/settings.py +++ b/tienda_ilusion/tienda_ilusion/settings.py @@ -9,6 +9,7 @@ https://docs.djangoproject.com/en/5.0/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/5.0/ref/settings/ """ +import os from pathlib import Path @@ -20,14 +21,18 @@ BASE_DIR = Path(__file__).resolve().parent.parent # See https://docs.djangoproject.com/en/5.0/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! -SECRET_KEY = 'django-insecure-zh6rinl@8y7g(cf781snisx2j%p^c#d&b2@@9cqe!v@4yv8x=v' +SECRET_KEY = os.environ.get( + "SECRET_KEY", + "django-insecure-zh6rinl@8y7g(cf781snisx2j%p^c#d&b2@@9cqe!v@4yv8x=v" +) # SECURITY WARNING: don't run with debug turned on in production! -DEBUG = True +DEBUG = True if os.environ.get("DEBUG", 'False') in ['True', '1'] else False +ALLOWED_HOSTS = os.environ.get('ALLOWED_HOSTS', 'localhost').split(',') -ALLOWED_HOSTS = ['localhost'] - -CORS_ALLOWED_ORIGINS = ['http://localhost:3000', 'http://localhost:7001'] +CORS_ALLOWED_ORIGINS = os.environ.get( + 'CORS_ALLOWED_ORIGINS', + 'http://localhost:3000,http://localhost:7001').split(',') # Application definition INSTALLED_APPS = [