added debug if/else

This commit is contained in:
Rushil Umaretiya 2020-09-21 19:21:56 -04:00
parent 00b225b008
commit 857a9aae9e

View File

@ -25,7 +25,10 @@ SECRET_KEY = secrets.SECRET_KEY
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = False
ALLOWED_HOSTS = ['hilo.link']
if DEBUG:
ALLOWED_HOSTS = ['*']
else:
ALLOWED_HOSTS = ['hilo.link', 'hi-loproject.com']
# Application definition
@ -79,18 +82,24 @@ WSGI_APPLICATION = 'config.wsgi.application'
# Database
# https://docs.djangoproject.com/en/3.0/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': secrets.DB_NAME,
'USER': secrets.DB_USER,
'PASSWORD': secrets.DB_PASS,
'HOST': 'localhost',
'PORT': '',
if not DEBUG:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': secrets.DB_NAME,
'USER': secrets.DB_USER,
'PASSWORD': secrets.DB_PASS,
'HOST': 'localhost',
'PORT': '',
}
}
else:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'db.sqlite3',
}
}
}
# Password validation
# https://docs.djangoproject.com/en/3.0/ref/settings/#auth-password-validators