|
1 | | -""" |
2 | | -Django settings for suorganizer project. |
| 1 | +# https://docs.djangoproject.com/en/1.8/topics/settings/ |
| 2 | +# https://docs.djangoproject.com/en/1.8/ref/settings/ |
3 | 3 |
|
4 | | -Generated by 'django-admin startproject' using Django 1.8. |
5 | | -
|
6 | | -For more information on this file, see |
7 | | -https://docs.djangoproject.com/en/1.8/topics/settings/ |
8 | | -
|
9 | | -For the full list of settings and their values, see |
10 | | -https://docs.djangoproject.com/en/1.8/ref/settings/ |
11 | | -""" |
12 | | - |
13 | | -# Build paths inside the project like this: os.path.join(BASE_DIR, ...) |
14 | 4 | import os |
15 | 5 |
|
16 | | -BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) |
17 | | - |
| 6 | +from django.core.urlresolvers import reverse_lazy |
18 | 7 |
|
19 | | -# Quick-start development settings - unsuitable for production |
20 | | -# See https://docs.djangoproject.com/en/1.8/howto/deployment/checklist/ |
| 8 | +BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(__file__))) |
21 | 9 |
|
22 | 10 | SITE_ID = 1 |
23 | 11 |
|
24 | | -# SECURITY WARNING: keep the secret key used in production secret! |
25 | | -SECRET_KEY = 'l)zht&^pddidsyqe$+09%se1*ba2#b_q-!j0^v$(-3c-=-vmq4' |
26 | | - |
27 | | -# SECURITY WARNING: don't run with debug turned on in production! |
28 | | -DEBUG = True |
29 | | - |
30 | | -ALLOWED_HOSTS = [] |
31 | | - |
32 | | - |
33 | | -# Application definition |
34 | | - |
35 | 12 | INSTALLED_APPS = ( |
36 | 13 | 'user', |
37 | 14 | 'django.contrib.admin', |
|
42 | 19 | 'django.contrib.sites', |
43 | 20 | 'django.contrib.sitemaps', |
44 | 21 | 'django.contrib.staticfiles', |
45 | | - 'debug_toolbar', |
46 | | - 'django_extensions', |
47 | 22 | 'core', |
48 | 23 | 'organizer', |
49 | 24 | 'blog', |
|
53 | 28 | MIDDLEWARE_CLASSES = ( |
54 | 29 | 'django.middleware.cache.UpdateCacheMiddleware', |
55 | 30 | 'django.contrib.sessions.middleware.SessionMiddleware', |
| 31 | + 'django.middleware.common.BrokenLinkEmailsMiddleware', |
56 | 32 | 'django.middleware.common.CommonMiddleware', |
57 | 33 | 'django.middleware.csrf.CsrfViewMiddleware', |
58 | 34 | 'django.contrib.auth.middleware.AuthenticationMiddleware', |
|
78 | 54 | 'django.contrib.messages.context_processors.messages', |
79 | 55 | ], |
80 | 56 | 'loaders': [ |
81 | | - # ('django.template.loaders.cached.Loader', [ |
82 | | - 'django.template.loaders.filesystem.Loader', |
83 | | - 'django.template.loaders.app_directories.Loader', |
84 | | - # ]), |
| 57 | + 'django.template.loaders.filesystem.Loader', |
| 58 | + 'django.template.loaders.app_directories.Loader', |
85 | 59 | ], |
86 | 60 | }, |
87 | 61 | }] |
88 | 62 |
|
89 | 63 | WSGI_APPLICATION = 'suorganizer.wsgi.application' |
90 | 64 |
|
91 | | - |
92 | | -# Caches |
93 | | -# https://docs.djangoproject.com/en/1.8/topics/cache/#local-memory-caching |
94 | | - |
95 | | -CACHES = { |
96 | | - 'default': { |
97 | | - 'BACKEND': 'django.core.cache.backends.dummy.DummyCache', |
98 | | - } |
99 | | -} |
100 | | -CACHE_MIDDLEWARE_ALIAS = 'default' |
101 | | - |
102 | | - |
103 | 65 | # User |
104 | 66 | # https://docs.djangoproject.com/en/1.8/topics/auth/customizing/#substituting-a-custom-user-model |
105 | 67 |
|
106 | 68 | AUTH_USER_MODEL = 'user.User' |
107 | 69 |
|
| 70 | +# Internationalization |
| 71 | +# https://docs.djangoproject.com/en/1.8/topics/i18n/ |
108 | 72 |
|
109 | | -# Database |
110 | | -# https://docs.djangoproject.com/en/1.8/ref/settings/#databases |
111 | | - |
112 | | -DATABASES = { |
113 | | - 'default': { |
114 | | - 'ENGINE': 'django.db.backends.sqlite3', |
115 | | - 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), |
116 | | - } |
117 | | -} |
| 73 | +LANGUAGE_CODE = 'en-us' |
118 | 74 |
|
| 75 | +TIME_ZONE = 'UTC' |
119 | 76 |
|
120 | | -# Logging |
121 | | -# https://docs.djangoproject.com/en/1.8/topics/logging/ |
| 77 | +USE_I18N = True |
122 | 78 |
|
123 | | -from .log_filters import ManagementFilter |
| 79 | +USE_L10N = True |
124 | 80 |
|
125 | | -verbose = ( |
126 | | - "[%(asctime)s] %(levelname)s " |
127 | | - "[%(name)s:%(lineno)s] %(message)s") |
| 81 | +USE_TZ = True |
128 | 82 |
|
129 | | -LOGGING = { |
130 | | - 'version': 1, |
131 | | - 'disable_existing_loggers': False, |
132 | | - 'filters': { |
133 | | - 'remove_migration_sql': { |
134 | | - '()': ManagementFilter, |
135 | | - }, |
136 | | - }, |
137 | | - 'handlers': { |
138 | | - 'console': { |
139 | | - 'filters': ['remove_migration_sql'], |
140 | | - 'class': 'logging.StreamHandler', |
141 | | - }, |
142 | | - }, |
143 | | - 'formatters': { |
144 | | - 'verbose': { |
145 | | - 'format': verbose, |
146 | | - 'datefmt': "%Y-%b-%d %H:%M:%S" |
147 | | - }, |
148 | | - }, |
149 | | - 'loggers': { |
150 | | - 'django': { |
151 | | - 'handlers': ['console'], |
152 | | - 'level': 'DEBUG', |
153 | | - 'formatter': 'verbose' |
154 | | - }, |
155 | | - }, |
156 | | -} |
| 83 | +# Login Settings |
| 84 | +# https://docs.djangoproject.com/en/1.8/topics/auth/ |
157 | 85 |
|
| 86 | +LOGIN_REDIRECT_URL = reverse_lazy('blog_post_list') |
| 87 | +LOGIN_URL = reverse_lazy('dj-auth:login') |
| 88 | +LOGOUT_URL = reverse_lazy('dj-auth:logout') |
158 | 89 |
|
159 | 90 | # Email |
160 | 91 | # https://docs.djangoproject.com/en/1.8/topics/email/ |
161 | 92 |
|
162 | | -EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' |
163 | 93 | SERVER_EMAIL = 'contact@django-unleashed.com' |
164 | 94 | DEFAULT_FROM_EMAIL = 'no-reply@django-unleashed.com' |
165 | 95 | EMAIL_SUBJECT_PREFIX = '[Startup Organizer] ' |
166 | 96 | MANAGERS = ( |
167 | 97 | ('Us', 'ourselves@django-unleashed.com'), |
168 | 98 | ) |
169 | 99 |
|
170 | | -# Internationalization |
171 | | -# https://docs.djangoproject.com/en/1.8/topics/i18n/ |
172 | | - |
173 | | -LANGUAGE_CODE = 'en-us' |
174 | | - |
175 | | -TIME_ZONE = 'UTC' |
176 | | - |
177 | | -USE_I18N = True |
178 | | - |
179 | | -USE_L10N = True |
180 | | - |
181 | | -USE_TZ = True |
182 | | - |
183 | | - |
184 | 100 | # Fixtures |
185 | 101 | # https://docs.djangoproject.com/en/1.8/topics/serialization/ |
186 | 102 |
|
|
192 | 108 |
|
193 | 109 | STATIC_URL = '/static/' |
194 | 110 | STATICFILES_DIRS = (os.path.join(BASE_DIR, "static"),) |
195 | | - |
196 | | -# Login Settings |
197 | | -# https://docs.djangoproject.com/en/1.8/topics/auth/ |
198 | | -from django.core.urlresolvers import reverse_lazy |
199 | | - |
200 | | -LOGIN_REDIRECT_URL = reverse_lazy('blog_post_list') |
201 | | -LOGIN_URL = reverse_lazy('dj-auth:login') |
202 | | -LOGOUT_URL = reverse_lazy('dj-auth:logout') |
| 111 | +STATIC_ROOT = os.path.join(BASE_DIR, 'collected_static') |
0 commit comments