mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-09-19 04:59:01 +00:00
Fixed issue with lost menus in Django 1.10
This commit is contained in:
parent
aad39e4001
commit
42e44ec689
@ -138,12 +138,6 @@ def setup_server():
|
|||||||
|
|
||||||
def configure_django():
|
def configure_django():
|
||||||
"""Setup Django configuration in the absense of .settings file"""
|
"""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 = {
|
logging_configuration = {
|
||||||
'version': 1,
|
'version': 1,
|
||||||
'disable_existing_loggers': False,
|
'disable_existing_loggers': False,
|
||||||
@ -211,6 +205,7 @@ def configure_django():
|
|||||||
{'ENGINE': 'django.db.backends.sqlite3',
|
{'ENGINE': 'django.db.backends.sqlite3',
|
||||||
'NAME': cfg.store_file}},
|
'NAME': cfg.store_file}},
|
||||||
DEBUG=cfg.debug,
|
DEBUG=cfg.debug,
|
||||||
|
FORCE_SCRIPT_NAME=cfg.server_dir,
|
||||||
INSTALLED_APPS=applications,
|
INSTALLED_APPS=applications,
|
||||||
LOGGING=logging_configuration,
|
LOGGING=logging_configuration,
|
||||||
LOGIN_URL='users:login',
|
LOGIN_URL='users:login',
|
||||||
@ -238,7 +233,7 @@ def configure_django():
|
|||||||
TEMPLATES=templates,
|
TEMPLATES=templates,
|
||||||
USE_L10N=True,
|
USE_L10N=True,
|
||||||
USE_X_FORWARDED_HOST=cfg.use_x_forwarded_host)
|
USE_X_FORWARDED_HOST=cfg.use_x_forwarded_host)
|
||||||
django.setup()
|
django.setup(set_prefix=True)
|
||||||
|
|
||||||
logger.info('Configured Django with applications - %s', applications)
|
logger.info('Configured Django with applications - %s', applications)
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user