##// END OF EJS Templates
Trying to enable etags support
neko259 -
r1142:ea496b22 default
parent child Browse files
Show More
@@ -1,237 +1,240 b''
1 1 # Django settings for neboard project.
2 2 import os
3 3
4 4 DEBUG = True
5 5 TEMPLATE_DEBUG = DEBUG
6 6
7 7 ADMINS = (
8 8 # ('Your Name', 'your_email@example.com'),
9 9 ('admin', 'admin@example.com')
10 10 )
11 11
12 12 MANAGERS = ADMINS
13 13
14 14 DATABASES = {
15 15 'default': {
16 16 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
17 17 'NAME': 'database.db', # Or path to database file if using sqlite3.
18 18 'USER': '', # Not used with sqlite3.
19 19 'PASSWORD': '', # Not used with sqlite3.
20 20 'HOST': '', # Set to empty string for localhost. Not used with sqlite3.
21 21 'PORT': '', # Set to empty string for default. Not used with sqlite3.
22 22 'CONN_MAX_AGE': None,
23 23 }
24 24 }
25 25
26 26 # Local time zone for this installation. Choices can be found here:
27 27 # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
28 28 # although not all choices may be available on all operating systems.
29 29 # In a Windows environment this must be set to your system time zone.
30 30 TIME_ZONE = 'Europe/Kiev'
31 31
32 32 # Language code for this installation. All choices can be found here:
33 33 # http://www.i18nguy.com/unicode/language-identifiers.html
34 34 LANGUAGE_CODE = 'en'
35 35
36 36 SITE_ID = 1
37 37
38 38 # If you set this to False, Django will make some optimizations so as not
39 39 # to load the internationalization machinery.
40 40 USE_I18N = True
41 41
42 42 # If you set this to False, Django will not format dates, numbers and
43 43 # calendars according to the current locale.
44 44 USE_L10N = True
45 45
46 46 # If you set this to False, Django will not use timezone-aware datetimes.
47 47 USE_TZ = True
48 48
49 USE_ETAGS = True
50
49 51 # Absolute filesystem path to the directory that will hold user-uploaded files.
50 52 # Example: "/home/media/media.lawrence.com/media/"
51 53 MEDIA_ROOT = './media/'
52 54
53 55 # URL that handles the media served from MEDIA_ROOT. Make sure to use a
54 56 # trailing slash.
55 57 # Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
56 58 MEDIA_URL = '/media/'
57 59
58 60 # Absolute path to the directory static files should be collected to.
59 61 # Don't put anything in this directory yourself; store your static files
60 62 # in apps' "static/" subdirectories and in STATICFILES_DIRS.
61 63 # Example: "/home/media/media.lawrence.com/static/"
62 64 STATIC_ROOT = ''
63 65
64 66 # URL prefix for static files.
65 67 # Example: "http://media.lawrence.com/static/"
66 68 STATIC_URL = '/static/'
67 69
68 70 # Additional locations of static files
69 71 # It is really a hack, put real paths, not related
70 72 STATICFILES_DIRS = (
71 73 os.path.dirname(__file__) + '/boards/static',
72 74
73 75 # '/d/work/python/django/neboard/neboard/boards/static',
74 76 # Put strings here, like "/home/html/static" or "C:/www/django/static".
75 77 # Always use forward slashes, even on Windows.
76 78 # Don't forget to use absolute paths, not relative paths.
77 79 )
78 80
79 81 # List of finder classes that know how to find static files in
80 82 # various locations.
81 83 STATICFILES_FINDERS = (
82 84 'django.contrib.staticfiles.finders.FileSystemFinder',
83 85 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
84 86 'compressor.finders.CompressorFinder',
85 87 )
86 88
87 89 if DEBUG:
88 90 STATICFILES_STORAGE = \
89 91 'django.contrib.staticfiles.storage.StaticFilesStorage'
90 92 else:
91 93 STATICFILES_STORAGE = \
92 94 'django.contrib.staticfiles.storage.CachedStaticFilesStorage'
93 95
94 96 # Make this unique, and don't share it with anybody.
95 97 SECRET_KEY = '@1rc$o(7=tt#kd+4s$u6wchm**z^)4x90)7f6z(i&55@o11*8o'
96 98
97 99 # List of callables that know how to import templates from various sources.
98 100 TEMPLATE_LOADERS = (
99 101 'django.template.loaders.filesystem.Loader',
100 102 'django.template.loaders.app_directories.Loader',
101 103 )
102 104
103 105 TEMPLATE_CONTEXT_PROCESSORS = (
104 106 'django.core.context_processors.media',
105 107 'django.core.context_processors.static',
106 108 'django.core.context_processors.request',
107 109 'django.contrib.auth.context_processors.auth',
108 110 'boards.context_processors.user_and_ui_processor',
109 111 )
110 112
111 113 MIDDLEWARE_CLASSES = (
114 'django.middleware.http.ConditionalGetMiddleware',
112 115 'django.contrib.sessions.middleware.SessionMiddleware',
113 116 'django.middleware.locale.LocaleMiddleware',
114 117 'django.middleware.common.CommonMiddleware',
115 118 'django.contrib.auth.middleware.AuthenticationMiddleware',
116 119 'django.contrib.messages.middleware.MessageMiddleware',
117 120 'boards.middlewares.BanMiddleware',
118 121 'boards.middlewares.TimezoneMiddleware',
119 122 )
120 123
121 124 ROOT_URLCONF = 'neboard.urls'
122 125
123 126 # Python dotted path to the WSGI application used by Django's runserver.
124 127 WSGI_APPLICATION = 'neboard.wsgi.application'
125 128
126 129 TEMPLATE_DIRS = (
127 130 # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
128 131 # Always use forward slashes, even on Windows.
129 132 # Don't forget to use absolute paths, not relative paths.
130 133 'templates',
131 134 )
132 135
133 136 INSTALLED_APPS = (
134 137 'django.contrib.auth',
135 138 'django.contrib.contenttypes',
136 139 'django.contrib.sessions',
137 140 # 'django.contrib.sites',
138 141 'django.contrib.messages',
139 142 'django.contrib.staticfiles',
140 143 # Uncomment the next line to enable the admin:
141 144 'django.contrib.admin',
142 145 # Uncomment the next line to enable admin documentation:
143 146 # 'django.contrib.admindocs',
144 147 'django.contrib.humanize',
145 148
146 149 'debug_toolbar',
147 150
148 151 # Search
149 152 'haystack',
150 153
151 154 'boards',
152 155 )
153 156
154 157 # A sample logging configuration. The only tangible logging
155 158 # performed by this configuration is to send an email to
156 159 # the site admins on every HTTP 500 error when DEBUG=False.
157 160 # See http://docs.djangoproject.com/en/dev/topics/logging for
158 161 # more details on how to customize your logging configuration.
159 162 LOGGING = {
160 163 'version': 1,
161 164 'disable_existing_loggers': False,
162 165 'formatters': {
163 166 'verbose': {
164 167 'format': '%(levelname)s %(asctime)s %(name)s %(process)d %(thread)d %(message)s'
165 168 },
166 169 'simple': {
167 170 'format': '%(levelname)s %(asctime)s [%(name)s] %(message)s'
168 171 },
169 172 },
170 173 'filters': {
171 174 'require_debug_false': {
172 175 '()': 'django.utils.log.RequireDebugFalse'
173 176 }
174 177 },
175 178 'handlers': {
176 179 'console': {
177 180 'level': 'DEBUG',
178 181 'class': 'logging.StreamHandler',
179 182 'formatter': 'simple'
180 183 },
181 184 },
182 185 'loggers': {
183 186 'boards': {
184 187 'handlers': ['console'],
185 188 'level': 'DEBUG',
186 189 }
187 190 },
188 191 }
189 192
190 193 HAYSTACK_CONNECTIONS = {
191 194 'default': {
192 195 'ENGINE': 'haystack.backends.whoosh_backend.WhooshEngine',
193 196 'PATH': os.path.join(os.path.dirname(__file__), 'whoosh_index'),
194 197 },
195 198 }
196 199
197 200 THEMES = [
198 201 ('md', 'Mystic Dark'),
199 202 ('md_centered', 'Mystic Dark (centered)'),
200 203 ('sw', 'Snow White'),
201 204 ('pg', 'Photon Gray'),
202 205 ]
203 206
204 207 IMAGE_VIEWERS = [
205 208 ('simple', 'Simple'),
206 209 ('popup', 'Popup'),
207 210 ]
208 211
209 212 POSTING_DELAY = 20 # seconds
210 213
211 214 # Websocket settins
212 215 CENTRIFUGE_HOST = 'localhost'
213 216 CENTRIFUGE_PORT = '9090'
214 217
215 218 CENTRIFUGE_ADDRESS = 'http://{}:{}'.format(CENTRIFUGE_HOST, CENTRIFUGE_PORT)
216 219 CENTRIFUGE_PROJECT_ID = '<project id here>'
217 220 CENTRIFUGE_PROJECT_SECRET = '<project secret here>'
218 221 CENTRIFUGE_TIMEOUT = 5
219 222
220 223 # Debug mode middlewares
221 224 if DEBUG:
222 225 MIDDLEWARE_CLASSES += (
223 226 'debug_toolbar.middleware.DebugToolbarMiddleware',
224 227 )
225 228
226 229 def custom_show_toolbar(request):
227 230 return True
228 231
229 232 DEBUG_TOOLBAR_CONFIG = {
230 233 'ENABLE_STACKTRACES': True,
231 234 'SHOW_TOOLBAR_CALLBACK': 'neboard.settings.custom_show_toolbar',
232 235 }
233 236
234 237 # FIXME Uncommenting this fails somehow. Need to investigate this
235 238 #DEBUG_TOOLBAR_PANELS += (
236 239 # 'debug_toolbar.panels.profiling.ProfilingDebugPanel',
237 240 #)
General Comments 0
You need to be logged in to leave comments. Login now