56
42
# Examples: "http://media.lawrence.com", "http://example.com/media/"
57
43
MEDIA_URL = '/wlmedia/'
59
# Absolute path where static files from thirdparty apps will be collected using
60
# the command: ./manage.py collectstatic
61
STATIC_ROOT = os.path.join(BASE_DIR, 'media/static_collected/')
63
# URL to use when referring to static files located in STATIC_ROOT.
64
# Must be different than MEDIA_URL!
65
# https://docs.djangoproject.com/en/1.8/howto/static-files/
66
STATIC_URL = '/static/'
45
# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
47
# Examples: "http://foo.com/media/", "/media/".
48
ADMIN_MEDIA_PREFIX = '/media/'
68
50
# Make this unique, and don't share it with anybody.
69
51
SECRET_KEY = '#*bc7*q0-br42fc&6l^x@zzk&(=-#gr!)fn@t30n54n05jkqcu'
73
# List of finder classes that know how to find static files in
75
STATICFILES_FINDERS = [
76
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
80
'django.contrib.admin',
81
'django.contrib.auth',
82
'django.contrib.contenttypes',
83
'django.contrib.sessions',
84
'django.contrib.messages',
85
'django.contrib.staticfiles',
86
'django.contrib.sites',
87
'django.contrib.humanize',
88
'django.contrib.sitemaps',
89
'nocaptcha_recaptcha',
92
'wiki.templatetags.restructuredtext',
101
'wlmaps.apps.WlMapsConfig',
105
'check_input.apps.CheckInput',
107
'privacy_policy.apps.PrivacyPolicyConfig',
108
'haystack', # search engine; see option HAYSTACK_CONNECTIONS
110
# Modified 3rd party apps
111
'wiki.apps.WikiConfig', # This is based on wikiapp, but has some local modifications
112
'news', # This is based on simple-blog, but has some local modifications
113
'pybb.apps.PybbConfig', # Feature enriched version of pybb
116
'threadedcomments', # included as wlapp
117
'notification', # included as wlapp
118
'django_messages_wl.apps.WLDjangoMessagesConfig',
125
'django.middleware.security.SecurityMiddleware',
53
# List of callables that know how to import templates from various sources.
55
'django.template.loaders.filesystem.load_template_source',
56
'django.template.loaders.app_directories.load_template_source',
57
# 'django.template.loaders.eggs.load_template_source',
60
MIDDLEWARE_CLASSES = (
61
# 'simplestats.middleware.RegexLoggingMiddleware',
62
'django.middleware.gzip.GZipMiddleware', # Remove this, when load gets to high
63
'django.middleware.common.CommonMiddleware',
126
64
'django.contrib.sessions.middleware.SessionMiddleware',
127
'django.middleware.common.CommonMiddleware',
128
'django.middleware.csrf.CsrfViewMiddleware',
129
65
'django.contrib.auth.middleware.AuthenticationMiddleware',
130
'django.contrib.messages.middleware.MessageMiddleware',
131
'django.middleware.clickjacking.XFrameOptionsMiddleware',
134
'dj_pagination.middleware.PaginationMiddleware',
135
'online_users_middleware.OnlineNowMiddleware',
140
'BACKEND': 'django.template.backends.django.DjangoTemplates',
141
'DIRS': [os.path.join(BASE_DIR, 'templates')],
144
'context_processors': [
145
'django.template.context_processors.debug',
146
'django.template.context_processors.request',
147
'django.contrib.auth.context_processors.auth',
148
'django.contrib.messages.context_processors.messages',
149
'django.template.context_processors.i18n',
150
'django.template.context_processors.media',
151
'django.template.context_processors.static',
152
'django.template.context_processors.tz',
153
'django_messages.context_processors.inbox',
154
'wlprofile.context_processors.deleted_user_data',
66
'pagination.middleware.PaginationMiddleware',
67
'tracking.middleware.VisitorTrackingMiddleware',
68
'tracking.middleware.VisitorCleanUpMiddleware',
71
ROOT_URLCONF = 'widelands.urls'
74
# Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
75
# Always use forward slashes, even on Windows.
76
# Don't forget to use absolute paths, not relative paths.
77
'/var/www/django_projects/widelands/templates',
80
TEMPLATE_CONTEXT_PROCESSORS = (
81
"django.core.context_processors.auth",
82
"django.core.context_processors.debug",
83
"django.core.context_processors.i18n",
84
"django.core.context_processors.media",
85
'django.core.context_processors.request',
160
88
############################
161
89
# Activation configuration #
162
90
############################
163
91
DEFAULT_FROM_EMAIL = 'noreply@widelands.org'
164
ACCOUNT_ACTIVATION_DAYS = 2 # Days an activation token keeps active
166
# Franku: SHA1 Needed as compatibility for old passwords
167
# https://docs.djangoproject.com/en/1.11/releases/1.10/#removed-weak-password-hashers-from-the-default-password-hashers-setting
169
'django.contrib.auth.hashers.PBKDF2PasswordHasher',
170
'django.contrib.auth.hashers.SHA1PasswordHasher'
92
ACCOUNT_ACTIVATION_DAYS=2 # Days an activation token keeps active
173
94
######################
174
95
# Wiki configuration #
175
96
######################
176
97
WIKI_LOCK_DURATION = 30
177
WIKI_URL_RE = r'[:\-\w ]+'
178
WIKI_WORD_RE = r'[:\-\w ]+'
180
99
######################
181
100
# User configuration #
182
101
######################
183
DEFAULT_TIME_ZONE = 3 # See wlprofile.templatetags.custom_date
184
DEFAULT_TIME_DISPLAY = r"%ND(Y-m-d,) H:i" # According to ISO 8601
185
DEFAULT_MARKUP = 'markdown'
102
AUTH_PROFILE_MODULE = 'wlprofile.Profile'
103
DEFAULT_TIME_ZONE = 3
104
DEFAULT_MARKUP ="markdown"
186
105
SIGNATURE_MAX_LENGTH = 255
187
106
SIGNATURE_MAX_LINES = 8
188
AVATARS_UPLOAD_TO = 'profile/avatars'
189
AVATAR_HEIGHT = AVATAR_WIDTH = 80
107
AVATARS_UPLOAD_TO = "profile/avatars"
108
AVATAR_HEIGHT = AVATAR_WIDTH = 80
191
110
######################
192
111
# Pybb Configuration #
193
112
######################
194
PYBB_ATTACHMENT_ENABLE = False # disable gzip middleware when enabling attachments
113
PYBB_ATTACHMENT_ENABLE = False
195
114
PYBB_DEFAULT_MARKUP = 'markdown'
196
PYBB_FREEZE_FIRST_POST = False
198
116
##############################################
199
117
# Link classification and other Markup stuff #
200
118
##############################################
201
119
LOCAL_DOMAINS = [
202
'xoops.widelands.org'
120
"xoops.widelands.org"
205
SMILEY_DIR = STATIC_URL + 'img/smileys/'
122
SMILEY_DIR = MEDIA_URL + "img/smileys/"
206
123
# Keep this list ordered by length of smileys
208
('O:-)', 'face-angel.png'),
209
('O:)', 'face-angel.png'),
210
(':-/', 'face-confused.png'),
211
(':/', 'face-confused.png'),
212
('B-)', 'face-cool.png'),
213
('B)', 'face-cool.png'),
214
(":'-(", 'face-crying.png'),
215
(":'(", 'face-crying.png'),
216
(':-))', 'face-smile-big.png'),
217
(':))', 'face-smile-big.png'),
218
(':-)', 'face-smile.png'),
219
(':)', 'face-smile.png'),
220
(']:-)', 'face-devilish.png'),
221
('8-)', 'face-glasses.png'),
222
('8)', 'face-glasses.png'),
223
(':-D', 'face-grin.png'),
224
(':D', 'face-grin.png'),
225
(':-x', 'face-kiss.png'),
226
(':x', 'face-kiss.png'),
227
(':-*', 'face-kiss.png'),
228
(':*', 'face-kiss.png'),
229
(':-((', 'face-mad.png'),
230
(':((', 'face-mad.png'),
231
(':-||', 'face-mad.png'),
232
(':||', 'face-mad.png'),
233
(':(|)', 'face-monkey.png'),
234
(':-|', 'face-plain.png'),
235
(':|', 'face-plain.png'),
236
(':-(', 'face-sad.png'),
237
(':(', 'face-sad.png'),
238
(':-O', 'face-shock.png'),
239
(':O', 'face-shock.png'),
240
(':-o', 'face-surprise.png'),
241
(':o', 'face-surprise.png'),
242
(':-P', 'face-tongue.png'),
243
(':P', 'face-tongue.png'),
244
(':-S', 'face-upset.png'),
245
(':S', 'face-upset.png'),
246
(';-)', 'face-wink.png'),
247
(';)', 'face-wink.png'),
253
HAYSTACK_CONNECTIONS = {
255
'ENGINE': 'haystack.backends.whoosh_backend.WhooshEngine',
256
'PATH': os.path.join(os.path.dirname(__file__), 'whoosh_index'),
125
("O:-)", "face-angel.png"),
126
(":'-(", "face-crying.png"),
127
(">:-)", "face-devilish.png"), # Hack around markdown replacement. see also SMILEY_PREESCAPING
128
(":(|)", "face-monkey.png"),
129
(":-D", "face-grin.png"),
130
("8-)", "face-glasses.png"),
131
(":-x", "face-kiss.png"),
132
(":-|", "face-plain.png"),
133
(":-(", "face-sad.png"),
134
(":))", "face-smile-big.png"),
135
(":-)", "face-smile.png"),
136
(":-O", "face-surprise.png"),
137
(";-)", "face-wink.png"),
138
(":D", "face-grin.png"),
139
(":(", "face-sad.png"),
140
(":)", "face-smile.png"),
141
(":O", "face-surprise.png"),
142
(";)", "face-wink.png"),
144
# This needs to be done to keep some stuff hidden from markdown
145
SMILEY_PREESCAPING = [
149
###############################
150
# Sphinx (Search prog) Config #
151
###############################
153
SPHINX_API_VERSION = 0x116
158
TRACKING_CLEANUP_TIMEOUT=48
260
160
###########################
261
161
# Widelands SVN directory #
263
163
# This is needed for various thinks, for example
264
164
# to access media (for minimap creation) or for online help
265
165
# or for ChangeLog displays
266
WIDELANDS_SVN_DIR = ''
168
#####################
169
# ChangeLog display #
170
#####################
171
BZR_URL = r"http://bazaar.launchpad.net/%%7Ewidelands-dev/widelands/trunk/revision/%s"
271
THUMBNAIL_SIZE = (160, 160)
278
##############################################
279
## Recipient(s) who get an email if someone ##
280
## uses the form on legal notice page ##
281
## Use allways the form ('name', 'Email') ##
282
##############################################
283
INQUIRY_RECIPIENTS = [
284
('peter', 'peter@example.com'),
287
##########################################
288
## Allowed tags/attributes for 'bleach' ##
289
## Used for sanitizing user input. ##
290
##########################################
291
BLEACH_ALLOWED_TAGS = [u'a',
296
u'em', u'i', u'strong', u'b',
299
u'h1', u'h2', u'h3', u'h4', u'h5', u'h6',
303
u'table', u'tbody', u'thead', u'th', u'tr', u'td',
307
BLEACH_ALLOWED_ATTRIBUTES = {'img': ['src', 'alt'], 'a': [
308
'href'], 'td': ['align'], '*': ['class', 'id', 'title']}
310
##########################
311
# Pagination settings #
312
# for dj-pagination #
313
##########################
314
PAGINATION_DEFAULT_WINDOW = 2
316
###########################
317
# Settings for displaying #
319
###########################
321
# Time in seconds how long a user will be shown online
322
ONLINE_THRESHOLD = 60 * 15
323
# Number of stored users
326
###########################################
327
# Settings for users who deleted themself #
328
###########################################
330
DELETED_MAIL_ADDRESS = ''
331
DELETED_USERNAME = 'Ex-Member'
337
# See: https://docs.djangoproject.com/en/dev/ref/settings/#csrf-cookie-age
338
CSRF_COOKIE_AGE = None
340
#############################
341
# star_rating configuration #
342
#############################
344
STAR_RATINGS_STAR_HEIGHT = 14
345
STAR_RATINGS_STAR_WIDTH = 14
346
STAR_RATINGS_RANGE = 10
176
THUMBNAIL_SIZE = ( 160, 160 )
179
'django.contrib.auth',
180
'django.contrib.contenttypes',
181
'django.contrib.sessions',
182
'django.contrib.sites',
183
'django.contrib.admin',
184
'django.contrib.markup',
185
'django.contrib.humanize',
187
# TODO: only temporary for webdesign stuff
188
'django.contrib.webdesign',
191
'widelands.mainpage',
192
'widelands.online_help',
193
'widelands.wlimages',
194
'widelands.wlwebchat',
195
'widelands.wlrecaptcha',
196
'widelands.wlprofile',
197
'widelands.wlsearch',
199
'widelands.wlevents',
201
'widelands.wlscreens',
203
# Modified 3rd party apps
204
'widelands.wiki', # This is based on wikiapp, but has some local modifications
205
'widelands.news', # This is based on simple-blog, but has some local modifications
206
'pybb', # Feature enriched version of pybb
211
'registration', # User registration (per Email validation)
349
221
from local_settings import *
350
222
except ImportError: