7 ADMIN_MEDIA_PREFIX = '/admin_media/'
8 SECRET_KEY = '$oo^&_m&qwbib=(_4m_n*zn-d=g#s0he5fx9xonnym#8p6yigm'
10 CACHE_MAX_KEY_LENGTH = 235
13 ('django.template.loaders.cached.Loader',(
14 'django.template.loaders.filesystem.load_template_source',
15 'django.template.loaders.app_directories.load_template_source',
16 'forum.modules.template_loader.module_templates_loader',
17 'forum.skins.load_template_source',
21 MIDDLEWARE_CLASSES = [
22 'django.middleware.csrf.CsrfViewMiddleware',
23 'django.middleware.csrf.CsrfResponseMiddleware',
24 'forum.middleware.django_cookies.CookiePreHandlerMiddleware',
25 'django.contrib.sessions.middleware.SessionMiddleware',
26 'django.middleware.common.CommonMiddleware',
27 'forum.middleware.extended_user.ExtendedUser',
28 'forum.middleware.anon_user.ConnectToSessionMessagesMiddleware',
29 'forum.middleware.request_utils.RequestUtils',
30 'forum.middleware.cancel.CancelActionMiddleware',
31 'forum.middleware.admin_messages.AdminMessagesMiddleware',
32 'forum.middleware.custom_pages.CustomPagesFallbackMiddleware',
33 'django.middleware.transaction.TransactionMiddleware',
34 'forum.middleware.django_cookies.CookiePostHandlerMiddleware',
37 TEMPLATE_CONTEXT_PROCESSORS = [
38 'django.core.context_processors.request',
39 'forum.context.application_settings',
40 'forum.user_messages.context_processors.user_messages',
41 'django.core.context_processors.auth',
48 os.path.join(os.path.dirname(__file__),'forum','skins').replace('\\','/'),
52 FILE_UPLOAD_TEMP_DIR = os.path.join(os.path.dirname(__file__), 'tmp').replace('\\','/')
53 FILE_UPLOAD_HANDLERS = ("django.core.files.uploadhandler.MemoryFileUploadHandler",
54 "django.core.files.uploadhandler.TemporaryFileUploadHandler",)
55 DEFAULT_FILE_STORAGE = 'django.core.files.storage.FileSystemStorage'
57 ALLOW_FILE_TYPES = ('.jpg', '.jpeg', '.gif', '.bmp', '.png', '.tiff')
58 ALLOW_MAX_FILE_SIZE = 1024 * 1024
61 from settings_local import *
64 if len(FORUM_SCRIPT_ALIAS) > 0:
65 APP_URL = '%s/%s' % (APP_URL, FORUM_SCRIPT_ALIAS[:-1])
69 app_url_split = APP_URL.split("://")
71 APP_PROTOCOL = app_url_split[0]
72 APP_DOMAIN = app_url_split[1].split('/')[0]
73 APP_BASE_URL = '%s://%s' % (APP_PROTOCOL, APP_DOMAIN)
75 FORCE_SCRIPT_NAME = ''
77 for path in app_url_split[1].split('/')[1:]:
78 FORCE_SCRIPT_NAME = FORCE_SCRIPT_NAME + '/' + path
80 if FORCE_SCRIPT_NAME.endswith('/'):
81 FORCE_SCRIPT_NAME = FORCE_SCRIPT_NAME[:-1]
83 #Module system initialization
84 MODULES_PACKAGE = 'forum_modules'
85 MODULES_FOLDER = os.path.join(SITE_SRC_ROOT, MODULES_PACKAGE)
87 MODULE_LIST = filter(lambda m: getattr(m, 'CAN_USE', True), [
88 __import__('forum_modules.%s' % f, globals(), locals(), ['forum_modules'])
89 for f in os.listdir(MODULES_FOLDER)
90 if os.path.isdir(os.path.join(MODULES_FOLDER, f)) and
91 os.path.exists(os.path.join(MODULES_FOLDER, "%s/__init__.py" % f)) and
92 not f in DISABLED_MODULES
95 [MIDDLEWARE_CLASSES.extend(
96 ["%s.%s" % (m.__name__, mc) for mc in getattr(m, 'MIDDLEWARE_CLASSES', [])]
97 ) for m in MODULE_LIST]
99 [TEMPLATE_LOADERS.extend(
100 ["%s.%s" % (m.__name__, tl) for tl in getattr(m, 'TEMPLATE_LOADERS', [])]
101 ) for m in MODULE_LIST]
105 'django.contrib.auth',
106 'django.contrib.contenttypes',
107 'django.contrib.sessions',
108 'django.contrib.sites',
109 'django.contrib.admin',
110 'django.contrib.humanize',
111 'django.contrib.sitemaps',
112 'django.contrib.markup',
119 MIDDLEWARE_CLASSES.append('debug_toolbar.middleware.DebugToolbarMiddleware')
120 INSTALLED_APPS.append('debug_toolbar')
126 INSTALLED_APPS.append('south')
130 # Try loading Gunicorn web server
133 INSTALLED_APPS.append('gunicorn')
140 INSTALLED_APPS.append('rosetta')
144 AUTHENTICATION_BACKENDS = ['django.contrib.auth.backends.ModelBackend',]