]> git.openstreetmap.org Git - osqa.git/blobdiff - settings.py
Reverting the merges due to unsuccessfull conflict resolvement.
[osqa.git] / settings.py
index a7c589300508523648a62fe07d68b59b85765799..6e7c106c3b886128e8366366b9e1f5f834b8504c 100644 (file)
@@ -28,6 +28,7 @@ MIDDLEWARE_CLASSES = [
     'forum.middleware.anon_user.ConnectToSessionMessagesMiddleware',
     'forum.middleware.request_utils.RequestUtils',
     'forum.middleware.cancel.CancelActionMiddleware',
     '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',
 ]
     #'recaptcha_django.middleware.ReCaptchaMiddleware',
     'django.middleware.transaction.TransactionMiddleware',
 ]
@@ -59,6 +60,26 @@ ALLOW_MAX_FILE_SIZE = 1024 * 1024
 # User settings
 from settings_local import *
 
 # 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',
 INSTALLED_APPS = [
     'django.contrib.auth',
     'django.contrib.contenttypes',