7 SECRET_KEY = 'a;::qCl1mfh?avagttOJ;8f5Rr54d,9qy7;o15M2cYO75?OQo51u3LnQ;!8N.:,7'
9 CACHE_MAX_KEY_LENGTH = 235
11 MIDDLEWARE_CLASSES = [
12 'django.middleware.csrf.CsrfViewMiddleware',
13 'forum.middleware.django_cookies.CookiePreHandlerMiddleware',
14 'django.contrib.sessions.middleware.SessionMiddleware',
15 'django.contrib.messages.middleware.MessageMiddleware',
16 'django.middleware.common.CommonMiddleware',
17 'forum.middleware.extended_user.ExtendedUser',
18 'forum.middleware.anon_user.ConnectToSessionMessagesMiddleware',
19 'forum.middleware.request_utils.RequestUtils',
20 'forum.middleware.cancel.CancelActionMiddleware',
21 'forum.middleware.admin_messages.AdminMessagesMiddleware',
22 'forum.middleware.custom_pages.CustomPagesFallbackMiddleware',
23 'django.middleware.transaction.TransactionMiddleware',
24 'forum.middleware.django_cookies.CookiePostHandlerMiddleware',
27 TEMPLATE_CONTEXT_PROCESSORS = [
28 'django.core.context_processors.request',
29 'forum.context.application_settings',
30 'django.contrib.messages.context_processors.messages',
31 'forum.user_messages.context_processors.user_messages',
32 'django.contrib.auth.context_processors.auth',
39 os.path.join(os.path.dirname(__file__),'forum','skins').replace('\\','/'),
43 FILE_UPLOAD_TEMP_DIR = os.path.join(os.path.dirname(__file__), 'tmp').replace('\\','/')
44 FILE_UPLOAD_HANDLERS = ("django.core.files.uploadhandler.MemoryFileUploadHandler",
45 "django.core.files.uploadhandler.TemporaryFileUploadHandler",)
46 DEFAULT_FILE_STORAGE = 'django.core.files.storage.FileSystemStorage'
48 ALLOW_FILE_TYPES = ('.jpg', '.jpeg', '.gif', '.bmp', '.png', '.tiff')
49 ALLOW_MAX_FILE_SIZE = 1024 * 1024
51 SESSION_SERIALIZER = 'django.contrib.sessions.serializers.PickleSerializer'
53 MESSAGE_STORAGE = 'django.contrib.messages.storage.session.SessionStorage'
56 from settings_local import *
59 'django.template.loaders.filesystem.Loader',
60 'django.template.loaders.app_directories.Loader',
61 'forum.modules.template_loader.module_templates_loader',
62 'forum.skins.load_template_source',
64 TEMPLATE_LOADERS = list(template_loaders) if DEBUG else [ ('django.template.loaders.cached.Loader', template_loaders) ]
67 if len(FORUM_SCRIPT_ALIAS) > 0:
68 APP_URL = '%s/%s' % (APP_URL, FORUM_SCRIPT_ALIAS[:-1])
72 app_url_split = APP_URL.split("://")
74 APP_PROTOCOL = app_url_split[0]
75 APP_DOMAIN = app_url_split[1].split('/')[0]
76 APP_BASE_URL = '%s://%s' % (APP_PROTOCOL, APP_DOMAIN)
78 FORCE_SCRIPT_NAME = ''
80 for path in app_url_split[1].split('/')[1:]:
81 FORCE_SCRIPT_NAME = FORCE_SCRIPT_NAME + '/' + path
83 if FORCE_SCRIPT_NAME.endswith('/'):
84 FORCE_SCRIPT_NAME = FORCE_SCRIPT_NAME[:-1]
86 #Module system initialization
87 MODULES_PACKAGE = 'forum_modules'
88 MODULES_FOLDER = os.path.join(SITE_SRC_ROOT, MODULES_PACKAGE)
90 MODULE_LIST = filter(lambda m: getattr(m, 'CAN_USE', True), [
91 __import__('forum_modules.%s' % f, globals(), locals(), ['forum_modules'])
92 for f in os.listdir(MODULES_FOLDER)
93 if os.path.isdir(os.path.join(MODULES_FOLDER, f)) and
94 os.path.exists(os.path.join(MODULES_FOLDER, "%s/__init__.py" % f)) and
95 not f in DISABLED_MODULES
98 [MIDDLEWARE_CLASSES.extend(
99 ["%s.%s" % (m.__name__, mc) for mc in getattr(m, 'MIDDLEWARE_CLASSES', [])]
100 ) for m in MODULE_LIST]
102 [TEMPLATE_LOADERS.extend(
103 ["%s.%s" % (m.__name__, tl) for tl in getattr(m, 'TEMPLATE_LOADERS', [])]
104 ) for m in MODULE_LIST]
108 'django.contrib.auth',
109 'django.contrib.contenttypes',
110 'django.contrib.sessions',
111 'django.contrib.sites',
112 'django.contrib.admin',
113 'django.contrib.humanize',
114 'django.contrib.sitemaps',
115 'django.contrib.messages',
122 MIDDLEWARE_CLASSES.append('debug_toolbar.middleware.DebugToolbarMiddleware')
123 INSTALLED_APPS.append('debug_toolbar')
129 INSTALLED_APPS.append('south')
133 # Try loading Gunicorn web server
136 INSTALLED_APPS.append('gunicorn')
143 INSTALLED_APPS.append('rosetta')
147 AUTHENTICATION_BACKENDS = ['django.contrib.auth.backends.ModelBackend',]