diff options
author | Rob Austein <sra@hactrn.net> | 2014-10-05 17:42:22 +0000 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2014-10-05 17:42:22 +0000 |
commit | 7d250756df425252344d29c54256ca141b915ed3 (patch) | |
tree | 767e199979f05abf950b918f49c06fe7e14d8697 /rpki/gui/script_util.py | |
parent | 4598ade64714fcbba5b8785ba84533522254708b (diff) | |
parent | d4f19b6a2957b11d286b1306cc1b209ee18e200c (diff) |
Pull from trunk.
svn path=/branches/tk705/; revision=5988
Diffstat (limited to 'rpki/gui/script_util.py')
-rw-r--r-- | rpki/gui/script_util.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/rpki/gui/script_util.py b/rpki/gui/script_util.py index 678ddae6..8919139c 100644 --- a/rpki/gui/script_util.py +++ b/rpki/gui/script_util.py @@ -32,6 +32,7 @@ def setup(): os.environ.update(DJANGO_SETTINGS_MODULE = "rpki.django_settings") else: + import django from rpki import config from rpki import autoconf from django.conf import settings @@ -46,6 +47,14 @@ def setup(): 'NAME': cfg.get('sql-database'), 'USER': cfg.get('sql-username'), 'PASSWORD': cfg.get('sql-password'), - } + }, }, + MIDDLEWARE_CLASSES = (), ) + # Can't populate apps if we don't know what they are. If this + # explodes with an AppRegistryNotReady exception, the above comment + # about not needing to set INSTALLED_APPS is no longer true and + # you'll need to fix that here. + if False and django.VERSION >= (1, 7): + from django.apps import apps + apps.populate(settings.INSTALLED_APPS) |