##// END OF EJS Templates
fix conflict
slemonide -
r1215:eec100b5 default
parent child Browse files
Show More
@@ -1,240 +1,239 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
49 USE_ETAGS = True
50
50
51 # 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.
52 # Example: "/home/media/media.lawrence.com/media/"
52 # Example: "/home/media/media.lawrence.com/media/"
53 MEDIA_ROOT = './media/'
53 MEDIA_ROOT = './media/'
54
54
55 # 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
56 # trailing slash.
56 # trailing slash.
57 # Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
57 # Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
58 MEDIA_URL = '/media/'
58 MEDIA_URL = '/media/'
59
59
60 # Absolute path to the directory static files should be collected to.
60 # Absolute path to the directory static files should be collected to.
61 # 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
62 # in apps' "static/" subdirectories and in STATICFILES_DIRS.
62 # in apps' "static/" subdirectories and in STATICFILES_DIRS.
63 # Example: "/home/media/media.lawrence.com/static/"
63 # Example: "/home/media/media.lawrence.com/static/"
64 STATIC_ROOT = ''
64 STATIC_ROOT = ''
65
65
66 # URL prefix for static files.
66 # URL prefix for static files.
67 # Example: "http://media.lawrence.com/static/"
67 # Example: "http://media.lawrence.com/static/"
68 STATIC_URL = '/static/'
68 STATIC_URL = '/static/'
69
69
70 # Additional locations of static files
70 # Additional locations of static files
71 # It is really a hack, put real paths, not related
71 # It is really a hack, put real paths, not related
72 STATICFILES_DIRS = (
72 STATICFILES_DIRS = (
73 os.path.dirname(__file__) + '/boards/static',
73 os.path.dirname(__file__) + '/boards/static',
74
74
75 # '/d/work/python/django/neboard/neboard/boards/static',
75 # '/d/work/python/django/neboard/neboard/boards/static',
76 # 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".
77 # Always use forward slashes, even on Windows.
77 # Always use forward slashes, even on Windows.
78 # Don't forget to use absolute paths, not relative paths.
78 # Don't forget to use absolute paths, not relative paths.
79 )
79 )
80
80
81 # 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
82 # various locations.
82 # various locations.
83 STATICFILES_FINDERS = (
83 STATICFILES_FINDERS = (
84 'django.contrib.staticfiles.finders.FileSystemFinder',
84 'django.contrib.staticfiles.finders.FileSystemFinder',
85 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
85 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
86 # 'compressor.finders.CompressorFinder',
87 )
86 )
88
87
89 if DEBUG:
88 if DEBUG:
90 STATICFILES_STORAGE = \
89 STATICFILES_STORAGE = \
91 'django.contrib.staticfiles.storage.StaticFilesStorage'
90 'django.contrib.staticfiles.storage.StaticFilesStorage'
92 else:
91 else:
93 STATICFILES_STORAGE = \
92 STATICFILES_STORAGE = \
94 'django.contrib.staticfiles.storage.CachedStaticFilesStorage'
93 'django.contrib.staticfiles.storage.CachedStaticFilesStorage'
95
94
96 # Make this unique, and don't share it with anybody.
95 # Make this unique, and don't share it with anybody.
97 SECRET_KEY = '@1rc$o(7=tt#kd+4s$u6wchm**z^)4x90)7f6z(i&55@o11*8o'
96 SECRET_KEY = '@1rc$o(7=tt#kd+4s$u6wchm**z^)4x90)7f6z(i&55@o11*8o'
98
97
99 # List of callables that know how to import templates from various sources.
98 # List of callables that know how to import templates from various sources.
100 TEMPLATE_LOADERS = (
99 TEMPLATE_LOADERS = (
101 'django.template.loaders.filesystem.Loader',
100 'django.template.loaders.filesystem.Loader',
102 'django.template.loaders.app_directories.Loader',
101 'django.template.loaders.app_directories.Loader',
103 )
102 )
104
103
105 TEMPLATE_CONTEXT_PROCESSORS = (
104 TEMPLATE_CONTEXT_PROCESSORS = (
106 'django.core.context_processors.media',
105 'django.core.context_processors.media',
107 'django.core.context_processors.static',
106 'django.core.context_processors.static',
108 'django.core.context_processors.request',
107 'django.core.context_processors.request',
109 'django.contrib.auth.context_processors.auth',
108 'django.contrib.auth.context_processors.auth',
110 'boards.context_processors.user_and_ui_processor',
109 'boards.context_processors.user_and_ui_processor',
111 )
110 )
112
111
113 MIDDLEWARE_CLASSES = (
112 MIDDLEWARE_CLASSES = (
114 'django.middleware.http.ConditionalGetMiddleware',
113 'django.middleware.http.ConditionalGetMiddleware',
115 'django.contrib.sessions.middleware.SessionMiddleware',
114 'django.contrib.sessions.middleware.SessionMiddleware',
116 'django.middleware.locale.LocaleMiddleware',
115 'django.middleware.locale.LocaleMiddleware',
117 'django.middleware.common.CommonMiddleware',
116 'django.middleware.common.CommonMiddleware',
118 'django.contrib.auth.middleware.AuthenticationMiddleware',
117 'django.contrib.auth.middleware.AuthenticationMiddleware',
119 'django.contrib.messages.middleware.MessageMiddleware',
118 'django.contrib.messages.middleware.MessageMiddleware',
120 'boards.middlewares.BanMiddleware',
119 'boards.middlewares.BanMiddleware',
121 'boards.middlewares.TimezoneMiddleware',
120 'boards.middlewares.TimezoneMiddleware',
122 )
121 )
123
122
124 ROOT_URLCONF = 'neboard.urls'
123 ROOT_URLCONF = 'neboard.urls'
125
124
126 # Python dotted path to the WSGI application used by Django's runserver.
125 # Python dotted path to the WSGI application used by Django's runserver.
127 WSGI_APPLICATION = 'neboard.wsgi.application'
126 WSGI_APPLICATION = 'neboard.wsgi.application'
128
127
129 TEMPLATE_DIRS = (
128 TEMPLATE_DIRS = (
130 # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
129 # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
131 # Always use forward slashes, even on Windows.
130 # Always use forward slashes, even on Windows.
132 # Don't forget to use absolute paths, not relative paths.
131 # Don't forget to use absolute paths, not relative paths.
133 'templates',
132 'templates',
134 )
133 )
135
134
136 INSTALLED_APPS = (
135 INSTALLED_APPS = (
137 'django.contrib.auth',
136 'django.contrib.auth',
138 'django.contrib.contenttypes',
137 'django.contrib.contenttypes',
139 'django.contrib.sessions',
138 'django.contrib.sessions',
140 # 'django.contrib.sites',
139 # 'django.contrib.sites',
141 'django.contrib.messages',
140 'django.contrib.messages',
142 'django.contrib.staticfiles',
141 'django.contrib.staticfiles',
143 # Uncomment the next line to enable the admin:
142 # Uncomment the next line to enable the admin:
144 'django.contrib.admin',
143 'django.contrib.admin',
145 # Uncomment the next line to enable admin documentation:
144 # Uncomment the next line to enable admin documentation:
146 # 'django.contrib.admindocs',
145 # 'django.contrib.admindocs',
147 #'django.contrib.humanize',
146 #'django.contrib.humanize',
148
147
149 'debug_toolbar',
148 'debug_toolbar',
150
149
151 # Search
150 # Search
152 'haystack',
151 'haystack',
153
152
154 'boards',
153 'boards',
155 )
154 )
156
155
157 # A sample logging configuration. The only tangible logging
156 # A sample logging configuration. The only tangible logging
158 # performed by this configuration is to send an email to
157 # performed by this configuration is to send an email to
159 # the site admins on every HTTP 500 error when DEBUG=False.
158 # the site admins on every HTTP 500 error when DEBUG=False.
160 # See http://docs.djangoproject.com/en/dev/topics/logging for
159 # See http://docs.djangoproject.com/en/dev/topics/logging for
161 # more details on how to customize your logging configuration.
160 # more details on how to customize your logging configuration.
162 LOGGING = {
161 LOGGING = {
163 'version': 1,
162 'version': 1,
164 'disable_existing_loggers': False,
163 'disable_existing_loggers': False,
165 'formatters': {
164 'formatters': {
166 'verbose': {
165 'verbose': {
167 'format': '%(levelname)s %(asctime)s %(name)s %(process)d %(thread)d %(message)s'
166 'format': '%(levelname)s %(asctime)s %(name)s %(process)d %(thread)d %(message)s'
168 },
167 },
169 'simple': {
168 'simple': {
170 'format': '%(levelname)s %(asctime)s [%(name)s] %(message)s'
169 'format': '%(levelname)s %(asctime)s [%(name)s] %(message)s'
171 },
170 },
172 },
171 },
173 'filters': {
172 'filters': {
174 'require_debug_false': {
173 'require_debug_false': {
175 '()': 'django.utils.log.RequireDebugFalse'
174 '()': 'django.utils.log.RequireDebugFalse'
176 }
175 }
177 },
176 },
178 'handlers': {
177 'handlers': {
179 'console': {
178 'console': {
180 'level': 'DEBUG',
179 'level': 'DEBUG',
181 'class': 'logging.StreamHandler',
180 'class': 'logging.StreamHandler',
182 'formatter': 'simple'
181 'formatter': 'simple'
183 },
182 },
184 },
183 },
185 'loggers': {
184 'loggers': {
186 'boards': {
185 'boards': {
187 'handlers': ['console'],
186 'handlers': ['console'],
188 'level': 'DEBUG',
187 'level': 'DEBUG',
189 }
188 }
190 },
189 },
191 }
190 }
192
191
193 HAYSTACK_CONNECTIONS = {
192 HAYSTACK_CONNECTIONS = {
194 'default': {
193 'default': {
195 'ENGINE': 'haystack.backends.whoosh_backend.WhooshEngine',
194 'ENGINE': 'haystack.backends.whoosh_backend.WhooshEngine',
196 'PATH': os.path.join(os.path.dirname(__file__), 'whoosh_index'),
195 'PATH': os.path.join(os.path.dirname(__file__), 'whoosh_index'),
197 },
196 },
198 }
197 }
199
198
200 THEMES = [
199 THEMES = [
201 ('md', 'Mystic Dark'),
200 ('md', 'Mystic Dark'),
202 ('md_centered', 'Mystic Dark (centered)'),
201 ('md_centered', 'Mystic Dark (centered)'),
203 ('sw', 'Snow White'),
202 ('sw', 'Snow White'),
204 ('pg', 'Photon Gray'),
203 ('pg', 'Photon Gray'),
205 ]
204 ]
206
205
207 IMAGE_VIEWERS = [
206 IMAGE_VIEWERS = [
208 ('simple', 'Simple'),
207 ('simple', 'Simple'),
209 ('popup', 'Popup'),
208 ('popup', 'Popup'),
210 ]
209 ]
211
210
212 POSTING_DELAY = 20 # seconds
211 POSTING_DELAY = 20 # seconds
213
212
214 # Websocket settins
213 # Websocket settins
215 CENTRIFUGE_HOST = 'localhost'
214 CENTRIFUGE_HOST = 'localhost'
216 CENTRIFUGE_PORT = '9090'
215 CENTRIFUGE_PORT = '9090'
217
216
218 CENTRIFUGE_ADDRESS = 'http://{}:{}'.format(CENTRIFUGE_HOST, CENTRIFUGE_PORT)
217 CENTRIFUGE_ADDRESS = 'http://{}:{}'.format(CENTRIFUGE_HOST, CENTRIFUGE_PORT)
219 CENTRIFUGE_PROJECT_ID = '<project id here>'
218 CENTRIFUGE_PROJECT_ID = '<project id here>'
220 CENTRIFUGE_PROJECT_SECRET = '<project secret here>'
219 CENTRIFUGE_PROJECT_SECRET = '<project secret here>'
221 CENTRIFUGE_TIMEOUT = 5
220 CENTRIFUGE_TIMEOUT = 5
222
221
223 # Debug mode middlewares
222 # Debug mode middlewares
224 if DEBUG:
223 if DEBUG:
225 MIDDLEWARE_CLASSES += (
224 MIDDLEWARE_CLASSES += (
226 'debug_toolbar.middleware.DebugToolbarMiddleware',
225 'debug_toolbar.middleware.DebugToolbarMiddleware',
227 )
226 )
228
227
229 def custom_show_toolbar(request):
228 def custom_show_toolbar(request):
230 return True
229 return True
231
230
232 DEBUG_TOOLBAR_CONFIG = {
231 DEBUG_TOOLBAR_CONFIG = {
233 'ENABLE_STACKTRACES': True,
232 'ENABLE_STACKTRACES': True,
234 'SHOW_TOOLBAR_CALLBACK': 'neboard.settings.custom_show_toolbar',
233 'SHOW_TOOLBAR_CALLBACK': 'neboard.settings.custom_show_toolbar',
235 }
234 }
236
235
237 # FIXME Uncommenting this fails somehow. Need to investigate this
236 # FIXME Uncommenting this fails somehow. Need to investigate this
238 #DEBUG_TOOLBAR_PANELS += (
237 #DEBUG_TOOLBAR_PANELS += (
239 # 'debug_toolbar.panels.profiling.ProfilingDebugPanel',
238 # 'debug_toolbar.panels.profiling.ProfilingDebugPanel',
240 #)
239 #)
General Comments 0
You need to be logged in to leave comments. Login now