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