From 853b0a600fc51db88c9e3379b150a57d443c199f Mon Sep 17 00:00:00 2001 From: Matias Vallejos Date: Tue, 30 Jan 2024 11:43:10 -0300 Subject: [PATCH] Improper settings.py for DEBUG --- app/todo_project/settings.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/todo_project/settings.py b/app/todo_project/settings.py index 5ea82b1..feb1deb 100644 --- a/app/todo_project/settings.py +++ b/app/todo_project/settings.py @@ -22,7 +22,7 @@ SECRET_KEY = os.environ.get("DJ_SECRET_KEY") # SECURITY WARNING: don't run with debug turned on in production! -DEBUG = os.environ.get("DEBUG", False) +DEBUG = os.environ.get("DEBUG", True) ALLOWED_HOSTS = ["*", "localhost", "127.0.0.1", ".vercel.app"] @@ -94,11 +94,6 @@ # https://docs.djangoproject.com/en/4.0/ref/settings/#databases if DEBUG: - DATABASE_URL = os.environ.get("DATABASE_URL") - DATABASES = { - "default": dj_database_url.config(default=DATABASE_URL, conn_max_age=600) - } -else: DB_NAME = os.getenv("MYSQL_DATABASE") DB_PASSWORD = os.getenv("MYSQL_DATABASE_PASSWORD") DB_USER = os.getenv("MYSQL_DATABASE_USER") @@ -111,6 +106,11 @@ "PORT": "3306", } } +else: + DATABASE_URL = os.environ.get("DATABASE_URL") + DATABASES = { + "default": dj_database_url.config(default=DATABASE_URL, conn_max_age=600) + } if "test" in sys.argv or "test_coverage" in sys.argv: DATABASES = {