##// END OF EJS Templates
Changed static files storage to cached one to allow versioning.
neko259 -
r259:d4948b22 default
parent child Browse files
Show More
@@ -1,209 +1,211 b''
1 # Django settings for neboard project.
1 # Django settings for neboard project.
2 import os
2 import os
3 import markdown
3 import markdown
4 from boards.mdx_neboard import markdown_extended
4 from boards.mdx_neboard import markdown_extended
5
5
6 DEBUG = True
6 DEBUG = True
7 TEMPLATE_DEBUG = DEBUG
7 TEMPLATE_DEBUG = DEBUG
8
8
9 ADMINS = (
9 ADMINS = (
10 # ('Your Name', 'your_email@example.com'),
10 # ('Your Name', 'your_email@example.com'),
11 ('admin', 'admin@example.com')
11 ('admin', 'admin@example.com')
12 )
12 )
13
13
14 MANAGERS = ADMINS
14 MANAGERS = ADMINS
15
15
16 DATABASES = {
16 DATABASES = {
17 'default': {
17 'default': {
18 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
18 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
19 'NAME': 'database.db', # Or path to database file if using sqlite3.
19 'NAME': 'database.db', # Or path to database file if using sqlite3.
20 'USER': '', # Not used with sqlite3.
20 'USER': '', # Not used with sqlite3.
21 'PASSWORD': '', # Not used with sqlite3.
21 'PASSWORD': '', # Not used with sqlite3.
22 'HOST': '', # Set to empty string for localhost. Not used with sqlite3.
22 'HOST': '', # Set to empty string for localhost. Not used with sqlite3.
23 'PORT': '', # Set to empty string for default. Not used with sqlite3.
23 'PORT': '', # Set to empty string for default. Not used with sqlite3.
24 }
24 }
25 }
25 }
26
26
27 # Local time zone for this installation. Choices can be found here:
27 # Local time zone for this installation. Choices can be found here:
28 # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
28 # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
29 # although not all choices may be available on all operating systems.
29 # although not all choices may be available on all operating systems.
30 # In a Windows environment this must be set to your system time zone.
30 # In a Windows environment this must be set to your system time zone.
31 TIME_ZONE = 'Europe/Kiev'
31 TIME_ZONE = 'Europe/Kiev'
32
32
33 # Language code for this installation. All choices can be found here:
33 # Language code for this installation. All choices can be found here:
34 # http://www.i18nguy.com/unicode/language-identifiers.html
34 # http://www.i18nguy.com/unicode/language-identifiers.html
35 LANGUAGE_CODE = 'en'
35 LANGUAGE_CODE = 'en'
36
36
37 SITE_ID = 1
37 SITE_ID = 1
38
38
39 # If you set this to False, Django will make some optimizations so as not
39 # If you set this to False, Django will make some optimizations so as not
40 # to load the internationalization machinery.
40 # to load the internationalization machinery.
41 USE_I18N = True
41 USE_I18N = True
42
42
43 # If you set this to False, Django will not format dates, numbers and
43 # If you set this to False, Django will not format dates, numbers and
44 # calendars according to the current locale.
44 # calendars according to the current locale.
45 USE_L10N = True
45 USE_L10N = True
46
46
47 # If you set this to False, Django will not use timezone-aware datetimes.
47 # If you set this to False, Django will not use timezone-aware datetimes.
48 USE_TZ = True
48 USE_TZ = 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 # Additional locations of static files
69 # Additional locations of static files
70 # It is really a hack, put real paths, not related
70 # It is really a hack, put real paths, not related
71 STATICFILES_DIRS = (
71 STATICFILES_DIRS = (
72 os.path.dirname(__file__) + '/boards/static',
72 os.path.dirname(__file__) + '/boards/static',
73
73
74 # '/d/work/python/django/neboard/neboard/boards/static',
74 # '/d/work/python/django/neboard/neboard/boards/static',
75 # Put strings here, like "/home/html/static" or "C:/www/django/static".
75 # Put strings here, like "/home/html/static" or "C:/www/django/static".
76 # Always use forward slashes, even on Windows.
76 # Always use forward slashes, even on Windows.
77 # Don't forget to use absolute paths, not relative paths.
77 # Don't forget to use absolute paths, not relative paths.
78 )
78 )
79
79
80 # List of finder classes that know how to find static files in
80 # List of finder classes that know how to find static files in
81 # various locations.
81 # various locations.
82 STATICFILES_FINDERS = (
82 STATICFILES_FINDERS = (
83 'django.contrib.staticfiles.finders.FileSystemFinder',
83 'django.contrib.staticfiles.finders.FileSystemFinder',
84 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
84 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
85 # 'django.contrib.staticfiles.finders.DefaultStorageFinder',
85 # 'django.contrib.staticfiles.finders.DefaultStorageFinder',
86 )
86 )
87
87
88 STATICFILES_STORAGE = 'django.contrib.staticfiles.storage.CachedStaticFilesStorage'
89
88 # Make this unique, and don't share it with anybody.
90 # Make this unique, and don't share it with anybody.
89 SECRET_KEY = '@1rc$o(7=tt#kd+4s$u6wchm**z^)4x90)7f6z(i&55@o11*8o'
91 SECRET_KEY = '@1rc$o(7=tt#kd+4s$u6wchm**z^)4x90)7f6z(i&55@o11*8o'
90
92
91 # List of callables that know how to import templates from various sources.
93 # List of callables that know how to import templates from various sources.
92 TEMPLATE_LOADERS = (
94 TEMPLATE_LOADERS = (
93 'django.template.loaders.filesystem.Loader',
95 'django.template.loaders.filesystem.Loader',
94 'django.template.loaders.app_directories.Loader',
96 'django.template.loaders.app_directories.Loader',
95 # 'django.template.loaders.eggs.Loader',
97 # 'django.template.loaders.eggs.Loader',
96 )
98 )
97
99
98 TEMPLATE_CONTEXT_PROCESSORS = (
100 TEMPLATE_CONTEXT_PROCESSORS = (
99 'django.core.context_processors.media',
101 'django.core.context_processors.media',
100 'django.core.context_processors.static',
102 'django.core.context_processors.static',
101 'django.core.context_processors.request',
103 'django.core.context_processors.request',
102 'django.contrib.auth.context_processors.auth',
104 'django.contrib.auth.context_processors.auth',
103 )
105 )
104
106
105 MIDDLEWARE_CLASSES = (
107 MIDDLEWARE_CLASSES = (
106 'django.contrib.sessions.middleware.SessionMiddleware',
108 'django.contrib.sessions.middleware.SessionMiddleware',
107 'django.middleware.locale.LocaleMiddleware',
109 'django.middleware.locale.LocaleMiddleware',
108 'django.middleware.common.CommonMiddleware',
110 'django.middleware.common.CommonMiddleware',
109 # 'django.middleware.csrf.CsrfViewMiddleware',
111 # 'django.middleware.csrf.CsrfViewMiddleware',
110 'django.contrib.auth.middleware.AuthenticationMiddleware',
112 'django.contrib.auth.middleware.AuthenticationMiddleware',
111 'django.contrib.messages.middleware.MessageMiddleware',
113 'django.contrib.messages.middleware.MessageMiddleware',
112 # Uncomment the next line for simple clickjacking protection:
114 # Uncomment the next line for simple clickjacking protection:
113 # 'django.middleware.clickjacking.XFrameOptionsMiddleware'
115 # 'django.middleware.clickjacking.XFrameOptionsMiddleware'
114 'boards.middlewares.BanMiddleware',
116 'boards.middlewares.BanMiddleware',
115 )
117 )
116
118
117 ROOT_URLCONF = 'neboard.urls'
119 ROOT_URLCONF = 'neboard.urls'
118
120
119 # Python dotted path to the WSGI application used by Django's runserver.
121 # Python dotted path to the WSGI application used by Django's runserver.
120 WSGI_APPLICATION = 'neboard.wsgi.application'
122 WSGI_APPLICATION = 'neboard.wsgi.application'
121
123
122 TEMPLATE_DIRS = (
124 TEMPLATE_DIRS = (
123 # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
125 # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
124 # Always use forward slashes, even on Windows.
126 # Always use forward slashes, even on Windows.
125 # Don't forget to use absolute paths, not relative paths.
127 # Don't forget to use absolute paths, not relative paths.
126 'templates',
128 'templates',
127 )
129 )
128
130
129 INSTALLED_APPS = (
131 INSTALLED_APPS = (
130 'django.contrib.auth',
132 'django.contrib.auth',
131 'django.contrib.contenttypes',
133 'django.contrib.contenttypes',
132 'django.contrib.sessions',
134 'django.contrib.sessions',
133 # 'django.contrib.sites',
135 # 'django.contrib.sites',
134 'django.contrib.messages',
136 'django.contrib.messages',
135 'django.contrib.staticfiles',
137 'django.contrib.staticfiles',
136 # Uncomment the next line to enable the admin:
138 # Uncomment the next line to enable the admin:
137 'django.contrib.admin',
139 'django.contrib.admin',
138 # Uncomment the next line to enable admin documentation:
140 # Uncomment the next line to enable admin documentation:
139 # 'django.contrib.admindocs',
141 # 'django.contrib.admindocs',
140 'django.contrib.markup',
142 'django.contrib.markup',
141 'django_cleanup',
143 'django_cleanup',
142 'boards',
144 'boards',
143 'captcha',
145 'captcha',
144 'south',
146 'south',
145 )
147 )
146
148
147 # TODO: NEED DESIGN FIXES
149 # TODO: NEED DESIGN FIXES
148 CAPTCHA_OUTPUT_FORMAT = (u' %(hidden_field)s '
150 CAPTCHA_OUTPUT_FORMAT = (u' %(hidden_field)s '
149 u'<div class="form-label">%(image)s</div>'
151 u'<div class="form-label">%(image)s</div>'
150 u'<div class="form-text">%(text_field)s</div>')
152 u'<div class="form-text">%(text_field)s</div>')
151
153
152 # A sample logging configuration. The only tangible logging
154 # A sample logging configuration. The only tangible logging
153 # performed by this configuration is to send an email to
155 # performed by this configuration is to send an email to
154 # the site admins on every HTTP 500 error when DEBUG=False.
156 # the site admins on every HTTP 500 error when DEBUG=False.
155 # See http://docs.djangoproject.com/en/dev/topics/logging for
157 # See http://docs.djangoproject.com/en/dev/topics/logging for
156 # more details on how to customize your logging configuration.
158 # more details on how to customize your logging configuration.
157 LOGGING = {
159 LOGGING = {
158 'version': 1,
160 'version': 1,
159 'disable_existing_loggers': False,
161 'disable_existing_loggers': False,
160 'filters': {
162 'filters': {
161 'require_debug_false': {
163 'require_debug_false': {
162 '()': 'django.utils.log.RequireDebugFalse'
164 '()': 'django.utils.log.RequireDebugFalse'
163 }
165 }
164 },
166 },
165 'handlers': {
167 'handlers': {
166 'mail_admins': {
168 'mail_admins': {
167 'level': 'ERROR',
169 'level': 'ERROR',
168 'filters': ['require_debug_false'],
170 'filters': ['require_debug_false'],
169 'class': 'django.utils.log.AdminEmailHandler'
171 'class': 'django.utils.log.AdminEmailHandler'
170 }
172 }
171 },
173 },
172 'loggers': {
174 'loggers': {
173 'django.request': {
175 'django.request': {
174 'handlers': ['mail_admins'],
176 'handlers': ['mail_admins'],
175 'level': 'ERROR',
177 'level': 'ERROR',
176 'propagate': True,
178 'propagate': True,
177 },
179 },
178 }
180 }
179 }
181 }
180
182
181 MARKUP_FIELD_TYPES = (
183 MARKUP_FIELD_TYPES = (
182 ('markdown', markdown_extended),
184 ('markdown', markdown_extended),
183 )
185 )
184 # Custom imageboard settings
186 # Custom imageboard settings
185 MAX_POSTS_PER_THREAD = 10 # Thread bumplimit
187 MAX_POSTS_PER_THREAD = 10 # Thread bumplimit
186 MAX_THREAD_COUNT = 500 # Old threads will be deleted to preserve this count
188 MAX_THREAD_COUNT = 500 # Old threads will be deleted to preserve this count
187 THREADS_PER_PAGE = 10
189 THREADS_PER_PAGE = 10
188 SITE_NAME = 'Neboard'
190 SITE_NAME = 'Neboard'
189
191
190 THEMES = [
192 THEMES = [
191 ('md', 'Mystic Dark'),
193 ('md', 'Mystic Dark'),
192 ('md_centered', 'Mystic Dark (centered)'),
194 ('md_centered', 'Mystic Dark (centered)'),
193 ('sw', 'Snow White'),
195 ('sw', 'Snow White'),
194 ('pg', 'Photon Gray'),
196 ('pg', 'Photon Gray'),
195 ]
197 ]
196
198
197 DEFAULT_THEME = 'md'
199 DEFAULT_THEME = 'md'
198
200
199 POPULAR_TAGS = 10
201 POPULAR_TAGS = 10
200 LAST_REPLIES_COUNT = 3
202 LAST_REPLIES_COUNT = 3
201
203
202 ENABLE_CAPTCHA = False
204 ENABLE_CAPTCHA = False
203 # if user tries to post before CAPTCHA_DEFAULT_SAFE_TIME. Captcha will be shown
205 # if user tries to post before CAPTCHA_DEFAULT_SAFE_TIME. Captcha will be shown
204 CAPTCHA_DEFAULT_SAFE_TIME = 30 # seconds
206 CAPTCHA_DEFAULT_SAFE_TIME = 30 # seconds
205 POSTING_DELAY = 30 # seconds
207 POSTING_DELAY = 30 # seconds
206
208
207 # Debug mode middlewares
209 # Debug mode middlewares
208 if DEBUG:
210 if DEBUG:
209 MIDDLEWARE_CLASSES += ('boards.profiler.ProfilerMiddleware',)
211 MIDDLEWARE_CLASSES += ('boards.profiler.ProfilerMiddleware',)
General Comments 0
You need to be logged in to leave comments. Login now