~widelands-dev/widelands-website/django_staticfiles

« back to all changes in this revision

Viewing changes to settings.py

  • Committer: Holger Rapp
  • Date: 2010-09-26 13:30:30 UTC
  • Revision ID: sirver@gmx.de-20100926133030-ceirjf83vde91tyt
Added a simple events model to display dates on the homepage

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# Django settings for widelands project.
2
2
 
3
 
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
4
 
import os
5
 
 
6
 
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
7
3
DEBUG = True
 
4
TEMPLATE_DEBUG = DEBUG
8
5
 
9
6
ADMINS = (
10
7
    # ('Your Name', 'your_email@domain.com'),
12
9
 
13
10
MANAGERS = ADMINS
14
11
 
15
 
DATABASES = {
16
 
    'default': {
17
 
        'ENGINE': 'django.db.backends.sqlite3',
18
 
        'NAME': 'dev.db',
19
 
        'USER': '',      # Not used with sqlite3.
20
 
        'PASSWORD': '',  # Not used with sqlite3.
21
 
        # Set to empty string for localhost. Not used with sqlite3.
22
 
        'HOST': '',
23
 
        # Set to empty string for default. Not used with sqlite3.
24
 
        'PORT': '',
25
 
    }
26
 
}
 
12
DATABASE_ENGINE = 'sqlite3'           # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
 
13
DATABASE_NAME = 'dev.db'             # Or path to database file if using sqlite3.
 
14
DATABASE_USER = ''             # Not used with sqlite3.
 
15
DATABASE_PASSWORD = ''         # Not used with sqlite3.
 
16
DATABASE_HOST = ''             # Set to empty string for localhost. Not used with sqlite3.
 
17
DATABASE_PORT = ''             # Set to empty string for default. Not used with sqlite3.
27
18
 
28
19
# Local time zone for this installation. Choices can be found here:
29
20
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
31
22
# If running in a Windows environment this must be set to the same as your
32
23
# system time zone.
33
24
TIME_ZONE = 'Europe/Berlin'
34
 
USE_TZ = False  # See https://docs.djangoproject.com/en/1.8/ref/settings/#std:setting-TIME_ZONE
35
25
 
36
26
# Language code for this installation. All choices can be found here:
37
27
# http://www.i18nguy.com/unicode/language-identifiers.html
38
 
LANGUAGE_CODE = 'en'
 
28
LANGUAGE_CODE = 'de'
39
29
 
40
30
SITE_ID = 1
41
31
 
42
 
# Where should logged in user go by default?
43
 
LOGIN_REDIRECT_URL = '/'
44
 
 
45
32
# If you set this to False, Django will make some optimizations so as not
46
33
# to load the internationalization machinery.
47
34
USE_I18N = False
48
35
 
49
36
# Absolute path to the directory that holds media.
50
37
# Example: "/home/media/media.lawrence.com/"
51
 
# Overwritten in local_settings.py
52
38
MEDIA_ROOT = ''
53
39
 
54
40
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
56
42
# Examples: "http://media.lawrence.com", "http://example.com/media/"
57
43
MEDIA_URL = '/wlmedia/'
58
44
 
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/')
62
 
 
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
 
46
# trailing slash.
 
47
# Examples: "http://foo.com/media/", "/media/".
 
48
ADMIN_MEDIA_PREFIX = '/media/'
67
49
 
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'
70
52
 
71
 
ROOT_URLCONF = 'urls'
72
 
 
73
 
# List of finder classes that know how to find static files in
74
 
# various locations.
75
 
STATICFILES_FINDERS = [
76
 
    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
77
 
]
78
 
 
79
 
INSTALLED_APPS = [
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',
90
 
 
91
 
    # Our own apps
92
 
    'wiki.templatetags.restructuredtext',
93
 
    'mainpage',
94
 
    'wlhelp',
95
 
    'wlimages',
96
 
    'wlwebchat',
97
 
    'wlprofile',
98
 
    'wlsearch',
99
 
    'wlpoll',
100
 
    'wlevents',
101
 
    'wlmaps.apps.WlMapsConfig',
102
 
    'wlscreens',
103
 
    'wlggz',
104
 
    'wlscheduling',
105
 
    'check_input.apps.CheckInput',
106
 
    'documentation',
107
 
    'privacy_policy.apps.PrivacyPolicyConfig',
108
 
    'haystack', # search engine; see option HAYSTACK_CONNECTIONS
109
 
 
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
114
 
 
115
 
    # Thirdparty apps
116
 
    'threadedcomments',  # included as wlapp
117
 
    'notification',     # included as wlapp
118
 
    'django_messages_wl.apps.WLDjangoMessagesConfig',
119
 
    'dj_pagination',
120
 
    'tagging',
121
 
    'star_ratings',
122
 
]
123
 
 
124
 
MIDDLEWARE = [
125
 
    'django.middleware.security.SecurityMiddleware',
 
53
# List of callables that know how to import templates from various sources.
 
54
TEMPLATE_LOADERS = (
 
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',
 
58
)
 
59
 
 
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',
132
 
    
133
 
    # Foreign middleware
134
 
    'dj_pagination.middleware.PaginationMiddleware',
135
 
    'online_users_middleware.OnlineNowMiddleware',
136
 
]
137
 
 
138
 
TEMPLATES = [
139
 
    {
140
 
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
141
 
        'DIRS': [os.path.join(BASE_DIR, 'templates')],
142
 
        'APP_DIRS': True,
143
 
        'OPTIONS': {
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',
155
 
            ],
156
 
        },
157
 
    },
158
 
]
 
66
    'pagination.middleware.PaginationMiddleware',
 
67
    'tracking.middleware.VisitorTrackingMiddleware',
 
68
    'tracking.middleware.VisitorCleanUpMiddleware',
 
69
)
 
70
 
 
71
ROOT_URLCONF = 'widelands.urls'
 
72
 
 
73
TEMPLATE_DIRS = (
 
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',
 
78
)
 
79
 
 
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',
 
86
)
159
87
 
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
165
 
 
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
168
 
PASSWORD_HASHERS = [
169
 
    'django.contrib.auth.hashers.PBKDF2PasswordHasher',
170
 
    'django.contrib.auth.hashers.SHA1PasswordHasher'
171
 
]
 
92
ACCOUNT_ACTIVATION_DAYS=2 # Days an activation token keeps active
172
93
 
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 ]+'
179
98
 
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
190
109
 
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
197
115
 
198
116
##############################################
199
117
# Link classification and other Markup stuff #
200
118
##############################################
201
119
LOCAL_DOMAINS = [
202
 
    'xoops.widelands.org'
 
120
    "xoops.widelands.org"
203
121
]
204
 
 
205
 
SMILEY_DIR = STATIC_URL + 'img/smileys/'
 
122
SMILEY_DIR = MEDIA_URL + "img/smileys/"
206
123
# Keep this list ordered by length of smileys
207
124
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'),
248
 
]
249
 
 
250
 
#################
251
 
# Search Config #
252
 
#################
253
 
HAYSTACK_CONNECTIONS = {
254
 
    'default': {
255
 
        'ENGINE': 'haystack.backends.whoosh_backend.WhooshEngine',
256
 
        'PATH': os.path.join(os.path.dirname(__file__), 'whoosh_index'),
257
 
    },
258
 
}
 
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"),
 
143
]
 
144
# This needs to be done to keep some stuff hidden from markdown
 
145
SMILEY_PREESCAPING = [
 
146
    (">:-)", "\>:-)"),
 
147
]
 
148
 
 
149
###############################
 
150
# Sphinx (Search prog) Config #
 
151
###############################
 
152
USE_SPHINX=False
 
153
SPHINX_API_VERSION = 0x116
 
154
 
 
155
############
 
156
# Tracking #
 
157
############
 
158
TRACKING_CLEANUP_TIMEOUT=48
259
159
 
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 = ''
 
166
WIDELANDS_SVN_DIR=""
 
167
 
 
168
#####################
 
169
# ChangeLog display #
 
170
#####################
 
171
BZR_URL = r"http://bazaar.launchpad.net/%%7Ewidelands-dev/widelands/trunk/revision/%s"
267
172
 
268
173
###############
269
174
# Screenshots #
270
175
###############
271
 
THUMBNAIL_SIZE = (160, 160)
272
 
 
273
 
########
274
 
# Maps #
275
 
########
276
 
MAPS_PER_PAGE = 10
277
 
 
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'),
285
 
]
286
 
 
287
 
##########################################
288
 
## Allowed tags/attributes for 'bleach' ##
289
 
## Used for sanitizing user input.      ##
290
 
##########################################
291
 
BLEACH_ALLOWED_TAGS = [u'a',
292
 
                       u'abbr',
293
 
                       u'acronym',
294
 
                       u'blockquote',
295
 
                       u'br',
296
 
                       u'em',  u'i',  u'strong', u'b',
297
 
                       u'ul',  u'ol', u'li',
298
 
                       u'div', u'p',
299
 
                       u'h1',  u'h2', u'h3', u'h4', u'h5', u'h6',
300
 
                       u'pre', u'code',
301
 
                       u'img',
302
 
                       u'hr',
303
 
                       u'table', u'tbody', u'thead', u'th', u'tr', u'td',
304
 
                       u'sup',
305
 
                       ]
306
 
 
307
 
BLEACH_ALLOWED_ATTRIBUTES = {'img': ['src', 'alt'], 'a': [
308
 
    'href'], 'td': ['align'], '*': ['class', 'id', 'title']}
309
 
 
310
 
##########################
311
 
# Pagination settings    #
312
 
# for dj-pagination      #
313
 
##########################
314
 
PAGINATION_DEFAULT_WINDOW = 2
315
 
 
316
 
###########################
317
 
# Settings for displaying #
318
 
# online users            #
319
 
###########################
320
 
 
321
 
# Time in seconds how long a user will be shown online
322
 
ONLINE_THRESHOLD = 60 * 15
323
 
# Number of stored users
324
 
ONLINE_MAX = 25
325
 
 
326
 
###########################################
327
 
# Settings for users who deleted themself #
328
 
###########################################
329
 
 
330
 
DELETED_MAIL_ADDRESS = ''
331
 
DELETED_USERNAME = 'Ex-Member'
332
 
 
333
 
###################
334
 
# Cookie settings #
335
 
###################
336
 
 
337
 
# See: https://docs.djangoproject.com/en/dev/ref/settings/#csrf-cookie-age
338
 
CSRF_COOKIE_AGE = None
339
 
 
340
 
#############################
341
 
# star_rating configuration #
342
 
#############################
343
 
 
344
 
STAR_RATINGS_STAR_HEIGHT = 14
345
 
STAR_RATINGS_STAR_WIDTH = 14
346
 
STAR_RATINGS_RANGE = 10
 
176
THUMBNAIL_SIZE = ( 160, 160 )
 
177
 
 
178
INSTALLED_APPS = (
 
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',
 
186
 
 
187
    # TODO: only temporary for webdesign stuff
 
188
    'django.contrib.webdesign',
 
189
 
 
190
    # Our own apps
 
191
    'widelands.mainpage',
 
192
    'widelands.online_help',
 
193
    'widelands.wlimages',
 
194
    'widelands.wlwebchat',
 
195
    'widelands.wlrecaptcha',
 
196
    'widelands.wlprofile',
 
197
    'widelands.wlsearch',
 
198
    'widelands.wlpoll',
 
199
    'widelands.wlevents',
 
200
    'widelands.wlmaps',
 
201
    'widelands.wlscreens',
 
202
 
 
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
 
207
 
 
208
    # Thirdparty apps
 
209
    'threadedcomments',
 
210
    'django_messages',
 
211
    'registration', # User registration (per Email validation)
 
212
    'pagination',
 
213
    'tagging',
 
214
    'notification',
 
215
    'tracking',
 
216
    'djangoratings',
 
217
    'sphinxdoc',
 
218
)
347
219
 
348
220
try:
349
221
    from local_settings import *
350
222
except ImportError:
351
223
    pass
 
224
 
 
225
if USE_SPHINX:
 
226
    INSTALLED_APPS += (
 
227
        'djangosphinx',
 
228
    )