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