File tree Expand file tree Collapse file tree 2 files changed +9
-11
lines changed Expand file tree Collapse file tree 2 files changed +9
-11
lines changed Original file line number Diff line number Diff line change 1212
1313import os
1414import json
15- import django_heroku
15+ import dj_database_url
16+
17+ from dotenv import load_dotenv
1618
1719# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
1820BASE_DIR = os .path .dirname (os .path .dirname (os .path .abspath (__file__ )))
1921
20-
22+ load_dotenv ( BASE_DIR / '.env' )
2123# Quick-start development settings - unsuitable for production
2224# See https://docs.djangoproject.com/en/3.0/howto/deployment/checklist/
2325
2729# SECURITY WARNING: don't run with debug turned on in production!
2830DEBUG = os .environ .get ('PRODUCTION' ) != 'true'
2931
30- ALLOWED_HOSTS = [ 'localhost' , 'https://django-blog-7rxa.onrender.com/' ]
32+ ALLOWED_HOSTS = os . getenv ( 'ALLOWED_HOSTS' ). split ( ' ' )
3133
3234
3335# Application definition
7981# https://docs.djangoproject.com/en/3.0/ref/settings/#databases
8082
8183DATABASES = {
82- 'default' : {
83- 'ENGINE' : 'django.db.backends.sqlite3' ,
84- 'NAME' : os .path .join (BASE_DIR , 'db.sqlite3' ),
85- }
84+ 'default' : dj_database_url .parse (os .environ .get ('DATABASE_URL' ), conn_max_age = 600 )
8685}
8786
8887
144143EMAIL_HOST_USER = os .environ .get ('EMAIL_USER' )
145144EMAIL_HOST_PASSWORD = os .environ .get ('EMAIL_PASS' )
146145DEFAULT_FROM_EMAIL = 'CodingWithAndrewTeam <noreply@codingwithandrew.com>'
147-
148- django_heroku .settings (locals ())
Original file line number Diff line number Diff line change @@ -8,8 +8,9 @@ django-heroku==0.3.1
88gunicorn == 20.0.4
99idna == 2.10
1010Pillow == 7.2.0
11- psycopg2 == 2.7.5
12- psycopg2-binary == 2.8.6
11+ psycopg2 == 2.9.5
12+ psycopg2-binary == 2.9.5
13+ python-dotenv == 0.21.1
1314pytz == 2020.1
1415requests == 2.24.0
1516sqlparse == 0.3.1
You can’t perform that action at this time.
0 commit comments