From 42e44ec689548f67039aaa223936196bed827bac Mon Sep 17 00:00:00 2001 From: Hemanth Kumar Veeranki Date: Tue, 9 Aug 2016 17:35:29 +0530 Subject: [PATCH] Fixed issue with lost menus in Django 1.10 --- plinth/__main__.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/plinth/__main__.py b/plinth/__main__.py index 08d1ad2d6..149f033a9 100644 --- a/plinth/__main__.py +++ b/plinth/__main__.py @@ -138,12 +138,6 @@ def setup_server(): def configure_django(): """Setup Django configuration in the absense of .settings file""" - - # In module_loader.py we reverse URLs for the menu before having a proper - # request. In this case, get_script_prefix (used by reverse) returns the - # wrong prefix. Set it here manually to have the correct prefix right away. - django.core.urlresolvers.set_script_prefix(cfg.server_dir) - logging_configuration = { 'version': 1, 'disable_existing_loggers': False, @@ -211,6 +205,7 @@ def configure_django(): {'ENGINE': 'django.db.backends.sqlite3', 'NAME': cfg.store_file}}, DEBUG=cfg.debug, + FORCE_SCRIPT_NAME=cfg.server_dir, INSTALLED_APPS=applications, LOGGING=logging_configuration, LOGIN_URL='users:login', @@ -238,7 +233,7 @@ def configure_django(): TEMPLATES=templates, USE_L10N=True, USE_X_FORWARDED_HOST=cfg.use_x_forwarded_host) - django.setup() + django.setup(set_prefix=True) logger.info('Configured Django with applications - %s', applications)