diff options
author | Rob Austein <sra@hactrn.net> | 2014-10-05 01:15:55 +0000 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2014-10-05 01:15:55 +0000 |
commit | d4f19b6a2957b11d286b1306cc1b209ee18e200c (patch) | |
tree | 7ec4338c4c19034e1669b1c1ffaddb647f867263 /rpki/rpkic.py | |
parent | 24635430e46c2fad0bdb5fb12fe18e212f76c437 (diff) |
Address incompatible API changes in Django 1.7: apps.populate(),
MIDDLEWARE_CLASSES. Fixes #717.
svn path=/trunk/; revision=5986
Diffstat (limited to 'rpki/rpkic.py')
-rw-r--r-- | rpki/rpkic.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/rpki/rpkic.py b/rpki/rpkic.py index d7b76c51..8ce28b59 100644 --- a/rpki/rpkic.py +++ b/rpki/rpkic.py @@ -132,6 +132,8 @@ class main(Cmd): self.histfile = cfg.get("history_file", os.path.expanduser("~/.rpkic_history")) self.autosync = cfg.getboolean("autosync", True, section = "rpkic") + import django + from django.conf import settings settings.configure( @@ -144,8 +146,13 @@ class main(Cmd): "PORT" : "", "OPTIONS" : { "init_command": "SET storage_engine=INNODB" }}}, INSTALLED_APPS = ("rpki.irdb",), + MIDDLEWARE_CLASSES = (), # API change, feh ) + if django.VERSION >= (1, 7): # API change, feh + from django.apps import apps + apps.populate(settings.INSTALLED_APPS) + import rpki.irdb # pylint: disable=W0621 try: |