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 'django.contrib.sessions.middleware.SessionMiddleware',
19 'django.middleware.common.CommonMiddleware',
20 'forum.middleware.extended_user.ExtendedUser',
21 'forum.middleware.anon_user.ConnectToSessionMessagesMiddleware',
22 'forum.middleware.request_utils.RequestUtils',
23 'forum.middleware.cancel.CancelActionMiddleware',
24 'forum.middleware.admin_messages.AdminMessagesMiddleware',
25 'django.middleware.transaction.TransactionMiddleware',
27 # Backwards compatibility. If we fail to import the CSRF middle-ware from the location
28 # where it is supposed to be, we add the old middle-ware classes to the classes list.
30 from django.middleware.csrf import CsrfViewMiddleware
31 MIDDLEWARE_CLASSES = [
32 'django.middleware.csrf.CsrfViewMiddleware',
33 'django.middleware.csrf.CsrfResponseMiddleware',
34 ] + MIDDLEWARE_CLASSES
36 MIDDLEWARE_CLASSES = [
37 'django.contrib.csrf.middleware.CsrfViewMiddleware',
38 'django.contrib.csrf.middleware.CsrfResponseMiddleware',
39 ] + MIDDLEWARE_CLASSES
41 TEMPLATE_CONTEXT_PROCESSORS = [
42 'django.core.context_processors.request',
43 'forum.context.application_settings',
44 'forum.user_messages.context_processors.user_messages',
45 'django.core.context_processors.auth',
52 os.path.join(os.path.dirname(__file__),'forum','skins').replace('\\','/'),
56 FILE_UPLOAD_TEMP_DIR = os.path.join(os.path.dirname(__file__), 'tmp').replace('\\','/')
57 FILE_UPLOAD_HANDLERS = ("django.core.files.uploadhandler.MemoryFileUploadHandler",
58 "django.core.files.uploadhandler.TemporaryFileUploadHandler",)
59 DEFAULT_FILE_STORAGE = 'django.core.files.storage.FileSystemStorage'
61 ALLOW_FILE_TYPES = ('.jpg', '.jpeg', '.gif', '.bmp', '.png', '.tiff')
62 ALLOW_MAX_FILE_SIZE = 1024 * 1024
65 from settings_local import *
68 if len(FORUM_SCRIPT_ALIAS) > 0:
69 APP_URL = '%s/%s' % (APP_URL, FORUM_SCRIPT_ALIAS[:-1])
73 app_url_split = APP_URL.split("://")
75 APP_PROTOCOL = app_url_split[0]
76 APP_DOMAIN = app_url_split[1].split('/')[0]
77 APP_BASE_URL = '%s://%s' % (APP_PROTOCOL, APP_DOMAIN)
79 FORCE_SCRIPT_NAME = ''
81 for path in app_url_split[1].split('/')[1:]:
82 FORCE_SCRIPT_NAME = FORCE_SCRIPT_NAME + '/' + path
84 if FORCE_SCRIPT_NAME.endswith('/'):
85 FORCE_SCRIPT_NAME = FORCE_SCRIPT_NAME[:-1]
87 #Module system initialization
88 MODULES_PACKAGE = 'forum_modules'
89 MODULES_FOLDER = os.path.join(SITE_SRC_ROOT, MODULES_PACKAGE)
91 MODULE_LIST = filter(lambda m: getattr(m, 'CAN_USE', True), [
92 __import__('forum_modules.%s' % f, globals(), locals(), ['forum_modules'])
93 for f in os.listdir(MODULES_FOLDER)
94 if os.path.isdir(os.path.join(MODULES_FOLDER, f)) and
95 os.path.exists(os.path.join(MODULES_FOLDER, "%s/__init__.py" % f)) and
96 not f in DISABLED_MODULES
99 [MIDDLEWARE_CLASSES.extend(
100 ["%s.%s" % (m.__name__, mc) for mc in getattr(m, 'MIDDLEWARE_CLASSES', [])]
101 ) for m in MODULE_LIST]
103 [TEMPLATE_LOADERS.extend(
104 ["%s.%s" % (m.__name__, tl) for tl in getattr(m, 'TEMPLATE_LOADERS', [])]
105 ) for m in MODULE_LIST]
109 'django.contrib.auth',
110 'django.contrib.contenttypes',
111 'django.contrib.sessions',
112 'django.contrib.sites',
113 'django.contrib.admin',
114 'django.contrib.humanize',
115 'django.contrib.sitemaps',
116 'django.contrib.markup',
123 MIDDLEWARE_CLASSES.append('debug_toolbar.middleware.DebugToolbarMiddleware')
124 INSTALLED_APPS.append('debug_toolbar')
130 INSTALLED_APPS.append('south')
137 INSTALLED_APPS.append('rosetta')
141 AUTHENTICATION_BACKENDS = ['django.contrib.auth.backends.ModelBackend',]