diff options
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) |