Skip to content

Commit

Permalink
Improper settings.py for DEBUG
Browse files Browse the repository at this point in the history
  • Loading branch information
matiasvallejosdev committed Jan 30, 2024
1 parent 02eef79 commit 853b0a6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions app/todo_project/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]

Expand Down Expand Up @@ -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")
Expand All @@ -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 = {
Expand Down

0 comments on commit 853b0a6

Please sign in to comment.