diff --git a/requirements.txt b/requirements.txt index d0867eed21030642592ddc8a26f527fc8c3582b4..97296184f693b8776f1f37ef6d433fdc3b3494dd 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,4 +2,5 @@ astroid==2.2.5 Django==2.1.7 selenium==3.141.0 gunicorn==19.9.0 -psycopg2==2.8.3 \ No newline at end of file +psycopg2==2.8.3 +dj-database-url==0.5.0 \ No newline at end of file diff --git a/superlists/settings.py b/superlists/settings.py index d9115b1024f094b18afc2aab5d1f9b8ca79b33cc..41fb5dd39a2bcf040e154d1ef19e14e6b3003e11 100644 --- a/superlists/settings.py +++ b/superlists/settings.py @@ -1,3 +1,4 @@ +import dj_database_url """ Django settings for superlists project. @@ -80,15 +81,13 @@ WSGI_APPLICATION = 'superlists.wsgi.application' DATABASES = { 'default': { - 'ENGINE': 'django.db.backends.postgresql_psycopg2', - 'NAME': 'todo_list', # os.environ.get('DB_NAME', ''), - 'USER': 'rahmania', # os.environ.get('DB_USER', ''), - 'PASSWORD': 'asdasd123', # os.environ.get('DB_PASS', ''), - 'HOST': 'localhost', - 'PORT': '5432' + 'ENGINE': 'django.db.backends.sqlite3', + 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), } } +db_from_env = dj_database_url.config(conn_max_age=500) +DATABASES['default'].update(db_from_env) # Password validation # https://docs.djangoproject.com/en/2.1/ref/settings/#auth-password-validators