aboutsummaryrefslogtreecommitdiff
path: root/rpki/irdbd.py
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2014-10-05 01:15:55 +0000
committerRob Austein <sra@hactrn.net>2014-10-05 01:15:55 +0000
commitd4f19b6a2957b11d286b1306cc1b209ee18e200c (patch)
tree7ec4338c4c19034e1669b1c1ffaddb647f867263 /rpki/irdbd.py
parent24635430e46c2fad0bdb5fb12fe18e212f76c437 (diff)
Address incompatible API changes in Django 1.7: apps.populate(),
MIDDLEWARE_CLASSES. Fixes #717. svn path=/trunk/; revision=5986
Diffstat (limited to 'rpki/irdbd.py')
-rw-r--r--rpki/irdbd.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/rpki/irdbd.py b/rpki/irdbd.py
index d53ae67c..ae08b6fb 100644
--- a/rpki/irdbd.py
+++ b/rpki/irdbd.py
@@ -186,6 +186,9 @@ class main(object):
def main(self):
global rpki # pylint: disable=W0602
+
+ import django
+
from django.conf import settings
startup_msg = self.cfg.get("startup-message", "")
@@ -211,7 +214,13 @@ class main(object):
"PASSWORD" : self.cfg.get("sql-password"),
"HOST" : "",
"PORT" : "" }},
- INSTALLED_APPS = ("rpki.irdb",),)
+ 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