~widelands-dev/widelands-website/trunk

« back to all changes in this revision

Viewing changes to mainpage/settings.py

  • Committer: kaputtnik
  • Date: 2019-09-03 06:16:23 UTC
  • mfrom: (544.2.25 pybb_attachments)
  • Revision ID: kaputtnik-20190903061623-xu4kvqpabnzmuskw
Allow file uploads in the forum; added some basic file checks to validate files

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Django settings for widelands project.
 
1
# Django default settings for widelands project.
 
2
# Overwrite these settings in local_settings.py!
2
3
 
3
4
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
4
5
import os
162
163
DEFAULT_FROM_EMAIL = 'noreply@widelands.org'
163
164
ACCOUNT_ACTIVATION_DAYS = 2  # Days an activation token keeps active
164
165
 
165
 
# Franku: SHA1 Needed as compatibility for old passwords
 
166
# SHA1 Needed as compatibility for old passwords
166
167
# https://docs.djangoproject.com/en/1.11/releases/1.10/#removed-weak-password-hashers-from-the-default-password-hashers-setting
167
168
PASSWORD_HASHERS = [
168
169
    'django.contrib.auth.hashers.PBKDF2PasswordHasher',
190
191
######################
191
192
# Pybb Configuration #
192
193
######################
193
 
# See also pybb defaults in pybb.settings.py
194
 
PYBB_ATTACHMENT_ENABLE = False  # disable gzip middleware when enabling attachments
 
194
 
 
195
PYBB_ATTACHMENT_ENABLE = True
 
196
 
 
197
# To prevent sending errors from the webserver, keep
 
198
# this below the webserver settings 
 
199
PYBB_ATTACHMENT_SIZE_LIMIT = 1024*1024*4
195
200
PYBB_DEFAULT_MARKUP = 'markdown'
196
 
INTERNAL_PERM='pybb.can_access_internal' # The permission string derived from pybb.models.category
 
201
INTERNAL_PERM = 'pybb.can_access_internal' # The permission string derived from pybb.models.category
 
202
 
 
203
##################################
 
204
# Uploading files and validation #
 
205
##################################
 
206
 
 
207
# Use only this handler to get real a file in /tmp
 
208
# Some validation checks needs a real file
 
209
FILE_UPLOAD_HANDLERS = [
 
210
    'django.core.files.uploadhandler.TemporaryFileUploadHandler',
 
211
    ]
 
212
 
 
213
ALLOWED_EXTENSIONS = [
 
214
    'wgf', 'jpg', 'jpeg', 'gif', 'png', 'ogg', 'lua',
 
215
    'ods', 'zip', 'json', 'txt', 'csv', 'wai',
 
216
    ]
 
217
 
 
218
# Widelands Savegame should contain at least these entries
 
219
WGF_CONTENT_CHECK = ['/binary/', '/map/', '/minimap.png', '/preload',]
 
220
 
 
221
# Do not check mime type for these extensions
 
222
SKIP_MIME_EXTENSIONS = ['wai',]
 
223
 
 
224
ALLOWED_WAI_SECTIONS = [
 
225
    'magic_numbers', 'neuron_values',
 
226
    'neuron_functions', 'fneurons',
 
227
    ]
 
228
 
 
229
# Allow attachments only after this amount of posts
 
230
ALLOW_ATTACHMENTS_AFTER = 5
 
231
 
 
232
# Page describing uploads
 
233
ATTACHMENT_DESCR_PAGE = 'Attachments'
 
234
 
 
235
# If clamav including clamdscan is installed and running
 
236
# set this to True
 
237
VIRUS_CHECK = False
197
238
 
198
239
##############################################
199
240
# Link classification and other Markup stuff #