2017-08-11 18:32:02 +00:00
|
|
|
import os
|
|
|
|
|
|
|
|
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
|
2017-08-19 14:16:51 +00:00
|
|
|
BASE_DIR = os.path.dirname(
|
|
|
|
os.path.dirname(
|
|
|
|
os.path.dirname(
|
|
|
|
os.path.abspath(__file__)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
2017-08-11 18:32:02 +00:00
|
|
|
|
|
|
|
|
2017-08-19 14:16:51 +00:00
|
|
|
# Applications
|
|
|
|
# https://docs.djangoproject.com/en/1.11/ref/applications/
|
2017-08-11 18:32:02 +00:00
|
|
|
|
|
|
|
INSTALLED_APPS = [
|
2017-08-13 14:48:16 +00:00
|
|
|
'api',
|
2017-08-16 16:46:26 +00:00
|
|
|
'babyblotter',
|
2017-08-13 14:48:16 +00:00
|
|
|
'core',
|
2017-08-18 13:02:31 +00:00
|
|
|
'dashboard',
|
2017-08-21 23:21:08 +00:00
|
|
|
'reports',
|
2017-08-13 14:48:16 +00:00
|
|
|
|
|
|
|
'rest_framework',
|
2017-08-15 20:50:09 +00:00
|
|
|
'widget_tweaks',
|
2017-08-13 14:48:16 +00:00
|
|
|
|
2017-08-11 18:32:02 +00:00
|
|
|
'django.contrib.admin',
|
|
|
|
'django.contrib.auth',
|
|
|
|
'django.contrib.contenttypes',
|
|
|
|
'django.contrib.sessions',
|
|
|
|
'django.contrib.messages',
|
|
|
|
'django.contrib.staticfiles',
|
|
|
|
]
|
|
|
|
|
2017-08-19 14:16:51 +00:00
|
|
|
# Middleware
|
|
|
|
# https://docs.djangoproject.com/en/1.11/ref/middleware/
|
|
|
|
|
2017-08-11 18:32:02 +00:00
|
|
|
MIDDLEWARE = [
|
|
|
|
'django.middleware.security.SecurityMiddleware',
|
|
|
|
'django.contrib.sessions.middleware.SessionMiddleware',
|
|
|
|
'django.middleware.common.CommonMiddleware',
|
|
|
|
'django.middleware.csrf.CsrfViewMiddleware',
|
|
|
|
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
|
|
|
'django.contrib.messages.middleware.MessageMiddleware',
|
|
|
|
'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
|
|
|
]
|
|
|
|
|
2017-08-19 14:16:51 +00:00
|
|
|
|
|
|
|
# URL dispatcher
|
|
|
|
# https://docs.djangoproject.com/en/1.11/topics/http/urls/
|
|
|
|
|
2017-08-11 18:32:02 +00:00
|
|
|
ROOT_URLCONF = 'babyblotter.urls'
|
|
|
|
|
2017-08-19 14:16:51 +00:00
|
|
|
|
|
|
|
# Templates
|
|
|
|
# https://docs.djangoproject.com/en/1.11/ref/templates/upgrading/#the-templates-settings
|
|
|
|
|
2017-08-11 18:32:02 +00:00
|
|
|
TEMPLATES = [
|
|
|
|
{
|
|
|
|
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
|
|
|
'DIRS': [],
|
|
|
|
'APP_DIRS': True,
|
|
|
|
'OPTIONS': {
|
|
|
|
'context_processors': [
|
|
|
|
'django.template.context_processors.debug',
|
|
|
|
'django.template.context_processors.request',
|
|
|
|
'django.contrib.auth.context_processors.auth',
|
|
|
|
'django.contrib.messages.context_processors.messages',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
]
|
|
|
|
|
|
|
|
|
2017-08-19 14:16:51 +00:00
|
|
|
# WGSI
|
|
|
|
# https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/
|
2017-08-11 18:32:02 +00:00
|
|
|
|
2017-08-19 14:16:51 +00:00
|
|
|
WSGI_APPLICATION = 'babyblotter.wsgi.application'
|
2017-08-11 18:32:02 +00:00
|
|
|
|
|
|
|
|
2017-08-16 16:46:26 +00:00
|
|
|
# Authentication
|
|
|
|
# https://docs.djangoproject.com/en/1.11/topics/auth/default/
|
|
|
|
|
|
|
|
LOGIN_REDIRECT_URL = '/'
|
|
|
|
|
|
|
|
LOGIN_URL = '/login/'
|
|
|
|
|
|
|
|
LOGOUT_REDIRECT_URL = '/login/'
|
|
|
|
|
|
|
|
|
2017-08-11 18:32:02 +00:00
|
|
|
# Internationalization
|
|
|
|
# https://docs.djangoproject.com/en/1.11/topics/i18n/
|
|
|
|
|
|
|
|
LANGUAGE_CODE = 'en-us'
|
|
|
|
|
2017-08-13 13:44:48 +00:00
|
|
|
TIME_ZONE = 'America/New_York'
|
2017-08-11 18:32:02 +00:00
|
|
|
|
|
|
|
USE_I18N = True
|
|
|
|
|
|
|
|
USE_L10N = True
|
|
|
|
|
|
|
|
USE_TZ = True
|
|
|
|
|
|
|
|
|
|
|
|
# Static files (CSS, JavaScript, Images)
|
|
|
|
# https://docs.djangoproject.com/en/1.11/howto/static-files/
|
|
|
|
|
|
|
|
STATIC_URL = '/static/'
|
2017-08-13 13:44:48 +00:00
|
|
|
|
2017-08-19 13:50:03 +00:00
|
|
|
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
|
|
|
|
|
|
|
|
STATICFILES_DIRS = [
|
2017-08-20 15:09:40 +00:00
|
|
|
os.path.join(BASE_DIR, 'babyblotter', 'static'),
|
2017-08-19 13:50:03 +00:00
|
|
|
]
|
|
|
|
|
2017-08-13 13:44:48 +00:00
|
|
|
|
|
|
|
# Django Rest Framework
|
|
|
|
# http://www.django-rest-framework.org/#
|
2017-08-19 14:16:51 +00:00
|
|
|
|
2017-08-13 13:44:48 +00:00
|
|
|
REST_FRAMEWORK = {
|
|
|
|
'DEFAULT_PERMISSION_CLASSES': [
|
2017-08-17 17:18:14 +00:00
|
|
|
'api.permissions.BabyBlotterDjangoModelPermissions'
|
2017-08-20 17:31:19 +00:00
|
|
|
],
|
|
|
|
'DEFAULT_RENDERER_CLASSES': (
|
|
|
|
'rest_framework.renderers.JSONRenderer',
|
|
|
|
)
|
2017-08-13 13:44:48 +00:00
|
|
|
}
|