Skip to content

Commit 35777c9

Browse files
committed
Made changed to use pythyon-dotenv #11
1 parent f2ce960 commit 35777c9

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

core/settings.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,25 @@
44
"""
55

66
import os
7-
from decouple import config
7+
8+
from dotenv import load_dotenv
89
from unipath import Path
910
import dj_database_url
1011

12+
load_dotenv()
13+
1114
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
1215
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
1316
PROJECT_DIR = Path(__file__).parent
1417

1518
# SECURITY WARNING: keep the secret key used in production secret!
16-
SECRET_KEY = config('SECRET_KEY', default='S#perS3crEt_1122')
19+
SECRET_KEY = os.getenv('SECRET_KEY', 'S#perS3crEt_1122')
1720

1821
# SECURITY WARNING: don't run with debug turned on in production!
19-
DEBUG = config('DEBUG', default=False)
22+
DEBUG = os.getenv('DEBUG', False)
2023

2124
# load production server from .env
22-
ALLOWED_HOSTS = ['localhost', '127.0.0.1', config('SERVER', default='127.0.0.1')]
25+
ALLOWED_HOSTS = ['localhost', '127.0.0.1', os.getenv('SERVER', '127.0.0.1')]
2326

2427
# Application definition
2528

requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
asgiref
22
autopep8
3-
django==2.2.10
3+
django
44
pycodestyle
55
pytz
66
sqlparse
77
Unipath
88
dj-database-url
9-
python-decouple
9+
python-dotenv
1010
gunicorn
1111
whitenoise
1212
django-import-export

0 commit comments

Comments
 (0)