Skip to content

Commit

Permalink
Made changed to use pythyon-dotenv #11
Browse files Browse the repository at this point in the history
  • Loading branch information
BenFaruna committed Jun 2, 2023
1 parent f2ce960 commit 35777c9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
11 changes: 7 additions & 4 deletions core/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,25 @@
"""

import os
from decouple import config

from dotenv import load_dotenv
from unipath import Path
import dj_database_url

load_dotenv()

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
PROJECT_DIR = Path(__file__).parent

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

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

# load production server from .env
ALLOWED_HOSTS = ['localhost', '127.0.0.1', config('SERVER', default='127.0.0.1')]
ALLOWED_HOSTS = ['localhost', '127.0.0.1', os.getenv('SERVER', '127.0.0.1')]

# Application definition

Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
asgiref
autopep8
django==2.2.10
django
pycodestyle
pytz
sqlparse
Unipath
dj-database-url
python-decouple
python-dotenv
gunicorn
whitenoise
django-import-export

0 comments on commit 35777c9

Please sign in to comment.