Create settings for dev and prod

This commit is contained in:
jaguarondi 2016-04-26 15:35:26 +02:00
parent 83240c211a
commit 3741436368
4 changed files with 57 additions and 17 deletions

View File

@ -0,0 +1,5 @@
try:
from .local import *
except ImportError:
# Dev env by defautl if no local file proviced
from .dev import *

View File

@ -13,18 +13,12 @@ https://docs.djangoproject.com/en/1.8/ref/settings/
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.8/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '5r4-zjux*_p7@^()pc+0sv(6rc@_vdjmce#!5!tx&qx7)opu$7'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
ALLOWED_HOSTS = []
@ -72,16 +66,6 @@ TEMPLATES = [
WSGI_APPLICATION = 'gwift.wsgi.application'
# Database
# https://docs.djangoproject.com/en/1.8/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}
# Internationalization
# https://docs.djangoproject.com/en/1.8/topics/i18n/

View File

@ -0,0 +1,29 @@
from .base import *
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '5r4-zjux*_p7@^()pc+0sv(6rc@_vdjmce#!5!tx&qx7)opu$7'
for template_engine in TEMPLATES:
template_engine['OPTIONS']['debug'] = True
'''INSTALLED_APPS += [
'debug_toolbar',
]'''
# Password validation
# https://docs.djangoproject.com/en/1.9/ref/settings/#auth-password-validators
AUTH_PASSWORD_VALIDATORS = []
# Database
# https://docs.djangoproject.com/en/1.8/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}

View File

@ -0,0 +1,22 @@
from .base import *
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = False
# Password validation
# https://docs.djangoproject.com/en/1.9/ref/settings/#auth-password-validators
AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
},
]