From d4f19b6a2957b11d286b1306cc1b209ee18e200c Mon Sep 17 00:00:00 2001 From: Rob Austein Date: Sun, 5 Oct 2014 01:15:55 +0000 Subject: Address incompatible API changes in Django 1.7: apps.populate(), MIDDLEWARE_CLASSES. Fixes #717. svn path=/trunk/; revision=5986 --- rpki/irdbd.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'rpki/irdbd.py') 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 -- cgit v1.2.3