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.filesystem.load_template_source',
14 'django.template.loaders.app_directories.load_template_source',
15 'forum.modules.template_loader.module_templates_loader',
16 'forum.skins.load_template_source',
19 MIDDLEWARE_CLASSES = [
20 'django.middleware.csrf.CsrfViewMiddleware',
21 'django.middleware.csrf.CsrfResponseMiddleware',
22 'forum.middleware.django_cookies.CookiePreHandlerMiddleware',
23 'django.contrib.sessions.middleware.SessionMiddleware',
24 'django.middleware.common.CommonMiddleware',
25 'forum.middleware.extended_user.ExtendedUser',
26 'forum.middleware.anon_user.ConnectToSessionMessagesMiddleware',
27 'forum.middleware.request_utils.RequestUtils',
28 'forum.middleware.cancel.CancelActionMiddleware',
29 'forum.middleware.admin_messages.AdminMessagesMiddleware',
30 'forum.middleware.custom_pages.CustomPagesFallbackMiddleware',
31 'django.middleware.transaction.TransactionMiddleware',
32 'forum.middleware.django_cookies.CookiePostHandlerMiddleware',
35 TEMPLATE_CONTEXT_PROCESSORS = [
36 'django.core.context_processors.request',
37 'forum.context.application_settings',
38 'forum.user_messages.context_processors.user_messages',
39 'django.core.context_processors.auth',
46 os.path.join(os.path.dirname(__file__),'forum','skins').replace('\\','/'),
50 FILE_UPLOAD_TEMP_DIR = os.path.join(os.path.dirname(__file__), 'tmp').replace('\\','/')
51 FILE_UPLOAD_HANDLERS = ("django.core.files.uploadhandler.MemoryFileUploadHandler",
52 "django.core.files.uploadhandler.TemporaryFileUploadHandler",)
53 DEFAULT_FILE_STORAGE = 'django.core.files.storage.FileSystemStorage'
55 ALLOW_FILE_TYPES = ('.jpg', '.jpeg', '.gif', '.bmp', '.png', '.tiff')
56 ALLOW_MAX_FILE_SIZE = 1024 * 1024
59 from settings_local import *
62 if len(FORUM_SCRIPT_ALIAS) > 0:
63 APP_URL = '%s/%s' % (APP_URL, FORUM_SCRIPT_ALIAS[:-1])
67 app_url_split = APP_URL.split("://")
69 APP_PROTOCOL = app_url_split[0]
70 APP_DOMAIN = app_url_split[1].split('/')[0]
71 APP_BASE_URL = '%s://%s' % (APP_PROTOCOL, APP_DOMAIN)
73 FORCE_SCRIPT_NAME = ''
75 for path in app_url_split[1].split('/')[1:]:
76 FORCE_SCRIPT_NAME = FORCE_SCRIPT_NAME + '/' + path
78 if FORCE_SCRIPT_NAME.endswith('/'):
79 FORCE_SCRIPT_NAME = FORCE_SCRIPT_NAME[:-1]
81 #Module system initialization
82 MODULES_PACKAGE = 'forum_modules'
83 MODULES_FOLDER = os.path.join(SITE_SRC_ROOT, MODULES_PACKAGE)
85 MODULE_LIST = filter(lambda m: getattr(m, 'CAN_USE', True), [
86 __import__('forum_modules.%s' % f, globals(), locals(), ['forum_modules'])
87 for f in os.listdir(MODULES_FOLDER)
88 if os.path.isdir(os.path.join(MODULES_FOLDER, f)) and
89 os.path.exists(os.path.join(MODULES_FOLDER, "%s/__init__.py" % f)) and
90 not f in DISABLED_MODULES
93 [MIDDLEWARE_CLASSES.extend(
94 ["%s.%s" % (m.__name__, mc) for mc in getattr(m, 'MIDDLEWARE_CLASSES', [])]
95 ) for m in MODULE_LIST]
97 [TEMPLATE_LOADERS.extend(
98 ["%s.%s" % (m.__name__, tl) for tl in getattr(m, 'TEMPLATE_LOADERS', [])]
99 ) for m in MODULE_LIST]
103 'django.contrib.auth',
104 'django.contrib.contenttypes',
105 'django.contrib.sessions',
106 'django.contrib.sites',
107 'django.contrib.admin',
108 'django.contrib.humanize',
109 'django.contrib.sitemaps',
110 'django.contrib.markup',
117 MIDDLEWARE_CLASSES.append('debug_toolbar.middleware.DebugToolbarMiddleware')
118 INSTALLED_APPS.append('debug_toolbar')
124 INSTALLED_APPS.append('south')
128 # Try loading Gunicorn web server
131 INSTALLED_APPS.append('gunicorn')
138 INSTALLED_APPS.append('rosetta')
142 AUTHENTICATION_BACKENDS = ['django.contrib.auth.backends.ModelBackend',]