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/rpkic.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'rpki/rpkic.py') 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: -- cgit v1.2.3