~widelands-dev/widelands-website/django_staticfiles

« back to all changes in this revision

Viewing changes to settings.py

  • Committer: franku
  • Date: 2018-04-26 20:18:55 UTC
  • mfrom: (489.1.28 widelands)
  • Revision ID: somal@arcor.de-20180426201855-uwt3b8gptpav6wrm
updated code base to fit with django 1.11.12; replaced app tracking with a new middleware

Show diffs side-by-side

added added

removed removed

Lines of Context:
67
67
    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
68
68
]
69
69
 
70
 
INSTALLED_APPS = (
 
70
INSTALLED_APPS = [
71
71
    'django.contrib.admin',
72
72
    'django.contrib.auth',
73
73
    'django.contrib.contenttypes',
78
78
    'django.contrib.humanize',
79
79
    'django.contrib.sitemaps',
80
80
    'nocaptcha_recaptcha',
81
 
    # Thirdparty apps, but need preload
82
 
    'tracking',  # included as wlapp
83
81
 
84
82
    # Our own apps
85
83
    'wiki.templatetags.restructuredtext',
91
89
    'wlsearch',
92
90
    'wlpoll',
93
91
    'wlevents',
94
 
    'wlmaps',
 
92
    'wlmaps.apps.WlMapsConfig',
95
93
    'wlscreens',
96
94
    'wlggz',
97
95
    'wlscheduling',
98
 
    'check_input',
 
96
    'check_input.apps.CheckInput',
99
97
    'haystack', # search engine; see option HAYSTACK_CONNECTIONS
100
98
 
101
99
    # Modified 3rd party apps
102
 
    'wiki',  # This is based on wikiapp, but has some local modifications
 
100
    'wiki.apps.WikiConfig',  # This is based on wikiapp, but has some local modifications
103
101
    'news',  # This is based on simple-blog, but has some local modifications
104
102
    'news.managers',
105
 
    'pybb',  # Feature enriched version of pybb
 
103
    'pybb.apps.PybbConfig',  # Feature enriched version of pybb
106
104
 
107
105
    # Thirdparty apps
108
106
    'threadedcomments',  # included as wlapp
109
107
    'notification',     # included as wlapp
110
 
    'django_messages',
111
 
    'linaro_django_pagination',
 
108
    'django_messages_wl.apps.WLDjangoMessagesConfig',
 
109
    'dj_pagination',
112
110
    'tagging',
113
111
    'djangoratings',    # included as wlapp
114
112
    'sphinxdoc',        # included as wlapp
115
 
)
 
113
]
116
114
 
117
 
MIDDLEWARE_CLASSES = (
 
115
MIDDLEWARE = [
 
116
    'django.middleware.security.SecurityMiddleware',
 
117
    'django.contrib.sessions.middleware.SessionMiddleware',
118
118
    'django.middleware.common.CommonMiddleware',
119
 
    'django.contrib.sessions.middleware.SessionMiddleware',
120
 
    'django.contrib.messages.middleware.MessageMiddleware',
121
119
    'django.middleware.csrf.CsrfViewMiddleware',
122
120
    'django.contrib.auth.middleware.AuthenticationMiddleware',
123
 
    'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
 
121
    'django.contrib.messages.middleware.MessageMiddleware',
124
122
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
125
 
    'django.middleware.security.SecurityMiddleware',
126
 
 
127
 
    'linaro_django_pagination.middleware.PaginationMiddleware',
128
 
    'tracking.middleware.VisitorTrackingMiddleware',
129
 
    'tracking.middleware.VisitorCleanUpMiddleware',
130
 
)
 
123
    
 
124
    # Foreign middleware
 
125
    'dj_pagination.middleware.PaginationMiddleware',
 
126
    'online_users_middleware.OnlineNowMiddleware',
 
127
]
131
128
 
132
129
TEMPLATES = [
133
130
    {
161
158
DEFAULT_FROM_EMAIL = 'noreply@widelands.org'
162
159
ACCOUNT_ACTIVATION_DAYS = 2  # Days an activation token keeps active
163
160
 
 
161
# Franku: SHA1 Needed as compatibility for old passwords
 
162
# https://docs.djangoproject.com/en/1.11/releases/1.10/#removed-weak-password-hashers-from-the-default-password-hashers-setting
 
163
PASSWORD_HASHERS = [
 
164
    'django.contrib.auth.hashers.PBKDF2PasswordHasher',
 
165
    'django.contrib.auth.hashers.SHA1PasswordHasher'
 
166
]
 
167
 
164
168
######################
165
169
# Wiki configuration #
166
170
######################
253
257
    },
254
258
}
255
259
 
256
 
############
257
 
# Tracking #
258
 
############
259
 
TRACKING_CLEANUP_TIMEOUT = 48
260
 
 
261
260
###########################
262
261
# Widelands SVN directory #
263
262
###########################
311
310
BLEACH_ALLOWED_ATTRIBUTES = {'img': ['src', 'alt'], 'a': [
312
311
    'href'], 'td': ['align'], '*': ['class', 'id', 'title']}
313
312
 
314
 
################################
315
 
# Pagination settings          #
316
 
# for linaro-django-pagination #
317
 
################################
 
313
##########################
 
314
# Pagination settings    #
 
315
# for dj-pagination      #
 
316
##########################
318
317
PAGINATION_DEFAULT_WINDOW = 2
319
318
 
 
319
###########################
 
320
# Settings for displaying #
 
321
# online users            #
 
322
###########################
 
323
 
 
324
# Time in seconds how long a user will be shown online
 
325
ONLINE_THRESHOLD = 60 * 30
 
326
# Number of stored users
 
327
ONLINE_MAX = 25
320
328
 
321
329
try:
322
330
    from local_settings import *