Skip to content

Commit 5cd807b

Browse files
Update settings.py
1 parent e60053e commit 5cd807b

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

django_blog/settings.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,12 @@
1414
import json
1515
import dj_database_url
1616

17+
from dotenv import load_dotenv
18+
1719
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
1820
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
1921

22+
load_dotenv(f"{BASE_DIR}/.env")
2023
# Quick-start development settings - unsuitable for production
2124
# See https://docs.djangoproject.com/en/3.0/howto/deployment/checklist/
2225

@@ -76,7 +79,7 @@
7679

7780
# Database
7881
# https://docs.djangoproject.com/en/3.0/ref/settings/#databases
79-
82+
print(os.environ.get('DATABASE_URL'))
8083
DATABASES = {
8184
'default': dj_database_url.parse(os.environ.get('DATABASE_URL'), conn_max_age=600)
8285
}

requirements.txt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
1-
asgiref==3.2.10
1+
asgiref==3.3.2
22
certifi==2020.6.20
33
chardet==3.0.4
4-
dj-database-url==0.5.0
5-
Django==3.1.1
4+
dj-database-url==1.2.0
5+
Django==3.2.0
66
django-crispy-forms==1.9.2
77
django-heroku==0.3.1
88
gunicorn==20.0.4
99
idna==2.10
10-
Pillow==7.2.0
10+
Pillow==9.4.0
1111
psycopg2==2.9.5
1212
psycopg2-binary==2.9.5
13+
python-dotenv==0.21.1
1314
pytz==2020.1
1415
requests==2.24.0
1516
sqlparse==0.3.1

0 commit comments

Comments
 (0)