X-Git-Url: https://git.openstreetmap.org./osqa.git/blobdiff_plain/1a949f7c97dc2f34c135f5cdf088df2927d3d652..13bee2f2e6aea2d936909861f3ab60bb09821a60:/settings.py diff --git a/settings.py b/settings.py index 246c317..6e7c106 100644 --- a/settings.py +++ b/settings.py @@ -28,6 +28,7 @@ MIDDLEWARE_CLASSES = [ 'forum.middleware.anon_user.ConnectToSessionMessagesMiddleware', 'forum.middleware.request_utils.RequestUtils', 'forum.middleware.cancel.CancelActionMiddleware', + 'forum.middleware.admin_messages.AdminMessagesMiddleware', #'recaptcha_django.middleware.ReCaptchaMiddleware', 'django.middleware.transaction.TransactionMiddleware', ] @@ -59,6 +60,26 @@ ALLOW_MAX_FILE_SIZE = 1024 * 1024 # User settings from settings_local import * +try: + if len(FORUM_SCRIPT_ALIAS) > 0: + APP_URL = '%s/%s' % (APP_URL, FORUM_SCRIPT_ALIAS[:-1]) +except NameError: + pass + +app_url_split = APP_URL.split("://") + +APP_PROTOCOL = app_url_split[0] +APP_DOMAIN = app_url_split[1].split('/')[0] +APP_BASE_URL = '%s://%s' % (APP_PROTOCOL, APP_DOMAIN) + +FORCE_SCRIPT_NAME = '' + +for path in app_url_split[1].split('/')[1:]: + FORCE_SCRIPT_NAME = FORCE_SCRIPT_NAME + '/' + path + +if FORCE_SCRIPT_NAME.endswith('/'): + FORCE_SCRIPT_NAME = FORCE_SCRIPT_NAME[:-1] + INSTALLED_APPS = [ 'django.contrib.auth', 'django.contrib.contenttypes', @@ -67,7 +88,7 @@ INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.humanize', 'django.contrib.sitemaps', - #'django.contrib.markup', + 'django.contrib.markup', 'forum', ] @@ -85,4 +106,11 @@ try: except: pass +if not DEBUG: + try: + import rosetta + INSTALLED_APPS.append('rosetta') + except: + pass + AUTHENTICATION_BACKENDS = ['django.contrib.auth.backends.ModelBackend',]