1
|
|
|
""" |
2
|
|
|
Django settings for nibble project. |
3
|
|
|
|
4
|
|
|
For more information on this file, see |
5
|
|
|
https://docs.djangoproject.com/en/1.11/topics/settings/ |
6
|
|
|
|
7
|
|
|
For the full list of settings and their values, see |
8
|
|
|
https://docs.djangoproject.com/en/1.11/ref/settings/ |
9
|
|
|
""" |
10
|
|
|
|
11
|
|
|
import os |
12
|
|
|
import sentry_sdk |
13
|
|
|
|
14
|
|
|
|
15
|
|
|
BASE_DIR = os.path.dirname(os.path.dirname(__file__)) |
16
|
|
|
|
17
|
|
|
|
18
|
|
|
# SECURITY WARNING: keep the secret key used in production secret! |
19
|
|
|
SECRET_KEY = os.environ.get('SECRET_KEY', 'please-change-me') |
20
|
|
|
|
21
|
|
|
# SECURITY WARNING: don't run with debug turned on in production! |
22
|
|
|
DEBUG = True |
23
|
|
|
|
24
|
|
|
TEMPLATES = [ |
25
|
|
|
{ |
26
|
|
|
'BACKEND': 'django.template.backends.django.DjangoTemplates', |
27
|
|
|
'APP_DIRS': True, |
28
|
|
|
'OPTIONS': { |
29
|
|
|
'context_processors': [ |
30
|
|
|
'django.contrib.auth.context_processors.auth', |
31
|
|
|
'django.contrib.messages.context_processors.messages', |
32
|
|
|
], |
33
|
|
|
}, |
34
|
|
|
}, |
35
|
|
|
] |
36
|
|
|
|
37
|
|
|
ALLOWED_HOSTS = [ |
38
|
|
|
'*', # STRANGER DANGER |
39
|
|
|
] |
40
|
|
|
|
41
|
|
|
|
42
|
|
|
# Application definition |
43
|
|
|
|
44
|
|
|
INSTALLED_APPS = ( |
45
|
|
|
'django.contrib.admin', |
46
|
|
|
'django.contrib.auth', |
47
|
|
|
'django.contrib.contenttypes', |
48
|
|
|
'django.contrib.sessions', |
49
|
|
|
'django.contrib.messages', |
50
|
|
|
'django.contrib.sites', |
51
|
|
|
'django.contrib.staticfiles', |
52
|
|
|
'behave_django', |
53
|
|
|
'accounts', |
54
|
|
|
'comics', |
55
|
|
|
|
56
|
|
|
'allauth', |
57
|
|
|
'allauth.account', |
58
|
|
|
'allauth.socialaccount', |
59
|
|
|
) |
60
|
|
|
|
61
|
|
|
MIDDLEWARE_CLASSES = ( |
62
|
|
|
'django.contrib.sessions.middleware.SessionMiddleware', |
63
|
|
|
'whitenoise.middleware.WhiteNoiseMiddleware', |
64
|
|
|
'django.middleware.common.CommonMiddleware', |
65
|
|
|
'django.middleware.csrf.CsrfViewMiddleware', |
66
|
|
|
'django.contrib.auth.middleware.AuthenticationMiddleware', |
67
|
|
|
'django.contrib.auth.middleware.SessionAuthenticationMiddleware', |
68
|
|
|
'django.contrib.messages.middleware.MessageMiddleware', |
69
|
|
|
'django.middleware.clickjacking.XFrameOptionsMiddleware', |
70
|
|
|
) |
71
|
|
|
|
72
|
|
|
ROOT_URLCONF = 'nibble.urls' |
73
|
|
|
|
74
|
|
|
WSGI_APPLICATION = 'nibble.wsgi.application' |
75
|
|
|
|
76
|
|
|
|
77
|
|
|
# Database |
78
|
|
|
DATABASES = { |
79
|
|
|
'default': { |
80
|
|
|
'ENGINE': 'django.db.backends.sqlite3', |
81
|
|
|
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), |
82
|
|
|
} |
83
|
|
|
} |
84
|
|
|
|
85
|
|
|
# Internationalization |
86
|
|
|
LANGUAGE_CODE = 'en-us' |
87
|
|
|
|
88
|
|
|
TIME_ZONE = 'UTC' |
89
|
|
|
|
90
|
|
|
USE_I18N = True |
91
|
|
|
|
92
|
|
|
USE_L10N = True |
93
|
|
|
|
94
|
|
|
USE_TZ = True |
95
|
|
|
|
96
|
|
|
|
97
|
|
|
# Static files (CSS, JavaScript, Images) |
98
|
|
|
STATIC_URL = '/static/' |
99
|
|
|
STATIC_ROOT = 'static' |
100
|
|
|
|
101
|
|
|
STATICFILES_DIRS = ( |
102
|
|
|
) |
103
|
|
|
|
104
|
|
|
|
105
|
|
|
# Authentication |
106
|
|
|
SITE_ID = 1 |
107
|
|
|
|
108
|
|
|
LOGIN_REDIRECT_URL = '/dashboard/' |
109
|
|
|
|
110
|
|
|
ACCOUNT_EMAIL_REQUIRED = True |
111
|
|
|
|
112
|
|
|
|
113
|
|
|
# Email |
114
|
|
|
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' |
115
|
|
|
|
116
|
|
|
|
117
|
|
|
# Sentry |
118
|
|
|
if 'SENTRY_URL' in os.environ: |
119
|
|
|
sentry_sdk.init(os.environ['SENTRY_URL']) |
120
|
|
|
|