Skip to content

Commit

Permalink
Remove mysql local client from settings.py
Browse files Browse the repository at this point in the history
  • Loading branch information
matiasvallejosdev committed Feb 13, 2024
1 parent e5232a9 commit 5d6fde1
Showing 1 changed file with 2 additions and 17 deletions.
19 changes: 2 additions & 17 deletions todo_project/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = os.environ.get("DEBUG", True)
print("DEBUG: ", DEBUG)

ALLOWED_HOSTS = ["*", "localhost", "127.0.0.1", ".vercel.app", ".now.sh"]

Expand Down Expand Up @@ -95,22 +94,8 @@
# Database
# https://docs.djangoproject.com/en/4.0/ref/settings/#databases

if DEBUG:
DB_NAME = os.getenv("MYSQL_DATABASE")
DB_PASSWORD = os.getenv("MYSQL_DATABASE_PASSWORD")
DB_USER = os.getenv("MYSQL_DATABASE_USER")
DATABASES = {
"default": {
"ENGINE": "django.db.backends.mysql",
"NAME": DB_NAME,
"PASSWORD": DB_PASSWORD,
"HOST": "localhost", # or the hostname where your MySQL server is running
"PORT": "3306",
}
}
else:
DATABASE_URL = os.environ.get("DATABASE_URL")
DATABASES = {"default": dj_database_url.config(default=DATABASE_URL, conn_max_age=600)}
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 5d6fde1

Please sign in to comment.