diff --git a/django_rest_api/.settings.py.swp b/django_rest_api/.settings.py.swp index 4188d2a..aeb72ee 100644 Binary files a/django_rest_api/.settings.py.swp and b/django_rest_api/.settings.py.swp differ diff --git a/django_rest_api/__pycache__/settings.cpython-39.pyc b/django_rest_api/__pycache__/settings.cpython-39.pyc index ad772fd..0d59d3e 100644 Binary files a/django_rest_api/__pycache__/settings.cpython-39.pyc and b/django_rest_api/__pycache__/settings.cpython-39.pyc differ diff --git a/django_rest_api/settings.py b/django_rest_api/settings.py index e632e4c..d7f5f9d 100644 --- a/django_rest_api/settings.py +++ b/django_rest_api/settings.py @@ -11,6 +11,7 @@ https://docs.djangoproject.com/en/3.1/ref/settings/ """ from pathlib import Path +import dj_database_url # add this # Build paths inside the project like this: BASE_DIR / 'subdir'. BASE_DIR = Path(__file__).resolve().parent.parent @@ -25,7 +26,7 @@ SECRET_KEY = '6d*ktt0=6-!)i1bdxk4(^)*ls-eseg(k12m2vefor1-g@vc5kn' # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True -ALLOWED_HOSTS = [] +ALLOWED_HOSTS = ['localhost', 'desolate-thicket-29906.herokuapp.com'] # Application definition @@ -89,6 +90,8 @@ DATABASES = { } } +db_from_env = dj_database_url.config(conn_max_age=600) # add this +DATABASES['default'].update(db_from_env) # add this # Password validation # https://docs.djangoproject.com/en/3.1/ref/settings/#auth-password-validators diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..fa365fe --- /dev/null +++ b/requirements.txt @@ -0,0 +1,9 @@ +asgiref==3.3.1 +dj-database-url==0.5.0 +Django==3.1.6 +django-cors-headers==3.7.0 +djangorestframework==3.12.2 +gunicorn==20.0.4 +psycopg2-binary==2.8.6 +pytz==2021.1 +sqlparse==0.4.1