7 ADMIN_MEDIA_PREFIX = '/admin_media/'
8 SECRET_KEY = '$oo^&_m&qwbib=(_4m_n*zn-d=g#s0he5fx9xonnym#8p6yigm'
11 'django.template.loaders.filesystem.load_template_source',
12 'django.template.loaders.app_directories.load_template_source',
13 'forum.modules.template_loader.module_templates_loader',
14 'forum.skins.load_template_source',
17 MIDDLEWARE_CLASSES = [
18 'forum.middleware.django_cookies.CookiePreHandlerMiddleware',
19 'django.contrib.sessions.middleware.SessionMiddleware',
20 'django.middleware.common.CommonMiddleware',
21 'forum.middleware.extended_user.ExtendedUser',
22 'forum.middleware.anon_user.ConnectToSessionMessagesMiddleware',
23 'forum.middleware.request_utils.RequestUtils',
24 'forum.middleware.cancel.CancelActionMiddleware',
25 'forum.middleware.admin_messages.AdminMessagesMiddleware',
26 'django.middleware.transaction.TransactionMiddleware',
27 'forum.middleware.django_cookies.CookiePostHandlerMiddleware',
29 # Backwards compatibility. If we fail to import the CSRF middle-ware from the location
30 # where it is supposed to be, we add the old middle-ware classes to the classes list.
32 from django.middleware.csrf import CsrfViewMiddleware
33 MIDDLEWARE_CLASSES = [
34 'django.middleware.csrf.CsrfViewMiddleware',
35 'django.middleware.csrf.CsrfResponseMiddleware',
36 ] + MIDDLEWARE_CLASSES
38 MIDDLEWARE_CLASSES = [
39 'django.contrib.csrf.middleware.CsrfViewMiddleware',
40 'django.contrib.csrf.middleware.CsrfResponseMiddleware',
41 ] + MIDDLEWARE_CLASSES
43 TEMPLATE_CONTEXT_PROCESSORS = [
44 'django.core.context_processors.request',
45 'forum.context.application_settings',
46 'forum.user_messages.context_processors.user_messages',
47 'django.core.context_processors.auth',
54 os.path.join(os.path.dirname(__file__),'forum','skins').replace('\\','/'),
58 FILE_UPLOAD_TEMP_DIR = os.path.join(os.path.dirname(__file__), 'tmp').replace('\\','/')
59 FILE_UPLOAD_HANDLERS = ("django.core.files.uploadhandler.MemoryFileUploadHandler",
60 "django.core.files.uploadhandler.TemporaryFileUploadHandler",)
61 DEFAULT_FILE_STORAGE = 'django.core.files.storage.FileSystemStorage'
63 ALLOW_FILE_TYPES = ('.jpg', '.jpeg', '.gif', '.bmp', '.png', '.tiff')
64 ALLOW_MAX_FILE_SIZE = 1024 * 1024
67 from settings_local import *
70 if len(FORUM_SCRIPT_ALIAS) > 0:
71 APP_URL = '%s/%s' % (APP_URL, FORUM_SCRIPT_ALIAS[:-1])
75 app_url_split = APP_URL.split("://")
77 APP_PROTOCOL = app_url_split[0]
78 APP_DOMAIN = app_url_split[1].split('/')[0]
79 APP_BASE_URL = '%s://%s' % (APP_PROTOCOL, APP_DOMAIN)
81 FORCE_SCRIPT_NAME = ''
83 for path in app_url_split[1].split('/')[1:]:
84 FORCE_SCRIPT_NAME = FORCE_SCRIPT_NAME + '/' + path
86 if FORCE_SCRIPT_NAME.endswith('/'):
87 FORCE_SCRIPT_NAME = FORCE_SCRIPT_NAME[:-1]
89 #Module system initialization
90 MODULES_PACKAGE = 'forum_modules'
91 MODULES_FOLDER = os.path.join(SITE_SRC_ROOT, MODULES_PACKAGE)
93 MODULE_LIST = filter(lambda m: getattr(m, 'CAN_USE', True), [
94 __import__('forum_modules.%s' % f, globals(), locals(), ['forum_modules'])
95 for f in os.listdir(MODULES_FOLDER)
96 if os.path.isdir(os.path.join(MODULES_FOLDER, f)) and
97 os.path.exists(os.path.join(MODULES_FOLDER, "%s/__init__.py" % f)) and
98 not f in DISABLED_MODULES
101 [MIDDLEWARE_CLASSES.extend(
102 ["%s.%s" % (m.__name__, mc) for mc in getattr(m, 'MIDDLEWARE_CLASSES', [])]
103 ) for m in MODULE_LIST]
105 [TEMPLATE_LOADERS.extend(
106 ["%s.%s" % (m.__name__, tl) for tl in getattr(m, 'TEMPLATE_LOADERS', [])]
107 ) for m in MODULE_LIST]
111 'django.contrib.auth',
112 'django.contrib.contenttypes',
113 'django.contrib.sessions',
114 'django.contrib.sites',
115 'django.contrib.admin',
116 'django.contrib.humanize',
117 'django.contrib.sitemaps',
118 'django.contrib.markup',
125 MIDDLEWARE_CLASSES.append('debug_toolbar.middleware.DebugToolbarMiddleware')
126 INSTALLED_APPS.append('debug_toolbar')
132 INSTALLED_APPS.append('south')
139 INSTALLED_APPS.append('rosetta')
143 AUTHENTICATION_BACKENDS = ['django.contrib.auth.backends.ModelBackend',]