~widelands-dev/widelands-website/solitaire_html_documentation

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
# Django settings for widelands project.

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import os

BASE_DIR = os.path.dirname(os.path.abspath(__file__))
DEBUG = True

ADMINS = (
    # ('Your Name', 'your_email@domain.com'),
)

MANAGERS = ADMINS

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': 'dev.db',
        'USER': '',      # Not used with sqlite3.
        'PASSWORD': '',  # Not used with sqlite3.
        # Set to empty string for localhost. Not used with sqlite3.
        'HOST': '',
        # Set to empty string for default. Not used with sqlite3.
        'PORT': '',
    }
}

# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
# although not all choices may be available on all operating systems.
# If running in a Windows environment this must be set to the same as your
# system time zone.
TIME_ZONE = 'Europe/Berlin'
USE_TZ = False  # See https://docs.djangoproject.com/en/1.8/ref/settings/#std:setting-TIME_ZONE

# Language code for this installation. All choices can be found here:
# http://www.i18nguy.com/unicode/language-identifiers.html
LANGUAGE_CODE = 'en'

SITE_ID = 1

# Where should logged in user go by default?
LOGIN_REDIRECT_URL = '/'

# If you set this to False, Django will make some optimizations so as not
# to load the internationalization machinery.
USE_I18N = False

# Absolute path to the directory that holds media.
# Example: "/home/media/media.lawrence.com/"
MEDIA_ROOT = ''

# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash if there is a path component (optional in other cases).
# Examples: "http://media.lawrence.com", "http://example.com/media/"
MEDIA_URL = '/wlmedia/'

# Make this unique, and don't share it with anybody.
SECRET_KEY = '#*bc7*q0-br42fc&6l^x@zzk&(=-#gr!)fn@t30n54n05jkqcu'

ROOT_URLCONF = 'urls'

# List of finder classes that know how to find static files in
# various locations.
STATICFILES_FINDERS = [
    'django.contrib.staticfiles.finders.FileSystemFinder',
    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
]

INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'django.contrib.sites',
    'django.contrib.humanize',
    'django.contrib.sitemaps',
    'nocaptcha_recaptcha',

    # Our own apps
    'wiki.templatetags.restructuredtext',
    'mainpage',
    'wlhelp',
    'wlimages',
    'wlwebchat',
    'wlprofile',
    'wlsearch',
    'wlpoll',
    'wlevents',
    'wlmaps.apps.WlMapsConfig',
    'wlscreens',
    'wlggz',
    'wlscheduling',
    'check_input.apps.CheckInput',
    'haystack', # search engine; see option HAYSTACK_CONNECTIONS

    # Modified 3rd party apps
    'wiki.apps.WikiConfig',  # This is based on wikiapp, but has some local modifications
    'news',  # This is based on simple-blog, but has some local modifications
    'news.managers',
    'pybb.apps.PybbConfig',  # Feature enriched version of pybb

    # Thirdparty apps
    'threadedcomments',  # included as wlapp
    'notification',     # included as wlapp
    'django_messages_wl.apps.WLDjangoMessagesConfig',
    'dj_pagination',
    'tagging',
    'djangoratings',    # included as wlapp
]

MIDDLEWARE = [
    'django.middleware.security.SecurityMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
    
    # Foreign middleware
    'dj_pagination.middleware.PaginationMiddleware',
    'online_users_middleware.OnlineNowMiddleware',
]

TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [os.path.join(BASE_DIR, 'templates')],
        'APP_DIRS': True,
        'OPTIONS': {
            'context_processors': [
                'django.template.context_processors.debug',
                'django.template.context_processors.request',
                'django.contrib.auth.context_processors.auth',
                'django.contrib.messages.context_processors.messages',
                'django.template.context_processors.i18n',
                'django.template.context_processors.media',
                'django.template.context_processors.static',
                'django.template.context_processors.tz',
                'django_messages.context_processors.inbox',
                'mainpage.context_processors.settings_for_templates',
            ],
        },
    },
]

# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.8/howto/static-files/
STATIC_URL = '/media/'

############################
# Activation configuration #
############################
DEFAULT_FROM_EMAIL = 'noreply@widelands.org'
ACCOUNT_ACTIVATION_DAYS = 2  # Days an activation token keeps active

# Franku: SHA1 Needed as compatibility for old passwords
# https://docs.djangoproject.com/en/1.11/releases/1.10/#removed-weak-password-hashers-from-the-default-password-hashers-setting
PASSWORD_HASHERS = [
    'django.contrib.auth.hashers.PBKDF2PasswordHasher',
    'django.contrib.auth.hashers.SHA1PasswordHasher'
]

######################
# Wiki configuration #
######################
WIKI_LOCK_DURATION = 30
WIKI_URL_RE = r'[:\-\w ]+'
WIKI_WORD_RE = r'[:\-\w ]+'

######################
# User configuration #
######################
DEFAULT_TIME_ZONE = 3  # See wlprofile.templatetags.custom_date
DEFAULT_TIME_DISPLAY = r"%ND(Y-m-d,) H:i"  # According to ISO 8601
DEFAULT_MARKUP = 'markdown'
SIGNATURE_MAX_LENGTH = 255
SIGNATURE_MAX_LINES = 8
AVATARS_UPLOAD_TO = 'profile/avatars'
AVATAR_HEIGHT = AVATAR_WIDTH = 80

######################
# Pybb Configuration #
######################
PYBB_ATTACHMENT_ENABLE = False  # disable gzip middleware when enabling attachments
PYBB_DEFAULT_MARKUP = 'markdown'
PYBB_FREEZE_FIRST_POST = False

##############################################
# Link classification and other Markup stuff #
##############################################
LOCAL_DOMAINS = [
    'xoops.widelands.org'
]

SMILEY_DIR = MEDIA_URL + 'img/smileys/'
# Keep this list ordered by length of smileys
SMILEYS = [
    ('O:-)', 'face-angel.png'),
    ('O:)', 'face-angel.png'),
    (':-/', 'face-confused.png'),
    (':/', 'face-confused.png'),
    ('B-)', 'face-cool.png'),
    ('B)', 'face-cool.png'),
    (":'-(", 'face-crying.png'),
    (":'(", 'face-crying.png'),
    (':-))', 'face-smile-big.png'),
    (':))', 'face-smile-big.png'),
    (':-)', 'face-smile.png'),
    (':)', 'face-smile.png'),
    # Hack around markdown replacement. see also SMILEY_PREESCAPING
    ('>:-)', 'face-devilish.png'),
    ('8-)', 'face-glasses.png'),
    ('8)', 'face-glasses.png'),
    (':-D', 'face-grin.png'),
    (':D', 'face-grin.png'),
    (':-x', 'face-kiss.png'),
    (':x', 'face-kiss.png'),
    (':-*', 'face-kiss.png'),
    (':*', 'face-kiss.png'),
    (':-((', 'face-mad.png'),
    (':((', 'face-mad.png'),
    (':-||', 'face-mad.png'),
    (':||', 'face-mad.png'),
    (':(|)', 'face-monkey.png'),
    (':-|', 'face-plain.png'),
    (':|', 'face-plain.png'),
    (':-(', 'face-sad.png'),
    (':(', 'face-sad.png'),
    (':-O', 'face-shock.png'),
    (':O', 'face-shock.png'),
    (':-o', 'face-surprise.png'),
    (':o', 'face-surprise.png'),
    (':-P', 'face-tongue.png'),
    (':P', 'face-tongue.png'),
    (':-S', 'face-upset.png'),
    (':S', 'face-upset.png'),
    (';-)', 'face-wink.png'),
    (';)', 'face-wink.png'),
]
# This needs to be done to keep some stuff hidden from markdown
SMILEY_PREESCAPING = [
    ('>:-)', '\>:-)')
]

#################
# Search Config #
#################
HAYSTACK_CONNECTIONS = {
    'default': {
        'ENGINE': 'haystack.backends.whoosh_backend.WhooshEngine',
        'PATH': os.path.join(os.path.dirname(__file__), 'whoosh_index'),
    },
}

###########################
# Widelands SVN directory #
###########################
# This is needed for various thinks, for example
# to access media (for minimap creation) or for online help
# or for ChangeLog displays
WIDELANDS_SVN_DIR = ''

###############
# Screenshots #
###############
THUMBNAIL_SIZE = (160, 160)

########
# Maps #
########
MAPS_PER_PAGE = 10


USE_GOOGLE_ANALYTICS = False

##############################################
## Recipient(s) who get an email if someone ##
## uses the form on legal notice page       ##
## Use allways the form ('name', 'Email')   ##
##############################################
INQUIRY_RECIPIENTS = [
    ('peter', 'peter@example.com'),
]

##########################################
## Allowed tags/attributes for 'bleach' ##
## Used for sanitizing user input.      ##
##########################################
BLEACH_ALLOWED_TAGS = [u'a',
                       u'abbr',
                       u'acronym',
                       u'blockquote',
                       u'br',
                       u'em',  u'i',  u'strong', u'b',
                       u'ul',  u'ol', u'li',
                       u'div', u'p',
                       u'h1',  u'h2', u'h3', u'h4', u'h5', u'h6',
                       u'pre', u'code',
                       u'img',
                       u'hr',
                       u'table', u'tbody', u'thead', u'th', u'tr', u'td',
                       u'sup',
                       ]

BLEACH_ALLOWED_ATTRIBUTES = {'img': ['src', 'alt'], 'a': [
    'href'], 'td': ['align'], '*': ['class', 'id', 'title']}

##########################
# Pagination settings    #
# for dj-pagination      #
##########################
PAGINATION_DEFAULT_WINDOW = 2

###########################
# Settings for displaying #
# online users            #
###########################

# Time in seconds how long a user will be shown online
ONLINE_THRESHOLD = 60 * 30
# Number of stored users
ONLINE_MAX = 25

try:
    from local_settings import *
except ImportError:
    print('Failed to load local_Settings.py !')
    pass