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