diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 7e9642c..2d174cc 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,3 +1,4 @@ +0.6.2 - Compat for middleware check 0.6.1 - Python 3 compatibility fix 0.6.0 - Version 0.6 (Django 1.10 support) 0.4.0 - Py3k support diff --git a/django_pdb/__init__.py b/django_pdb/__init__.py index 762bf68..db2ac1c 100644 --- a/django_pdb/__init__.py +++ b/django_pdb/__init__.py @@ -1,6 +1,6 @@ from __future__ import print_function from django.conf import settings -__version__ = '0.6.1' +__version__ = '0.6.2' POST_MORTEM = getattr(settings, 'POST_MORTEM', False) DEBUG = getattr(settings, 'DEBUG', False) diff --git a/django_pdb/management/commands/runserver.py b/django_pdb/management/commands/runserver.py index 68bf91f..56c4efe 100644 --- a/django_pdb/management/commands/runserver.py +++ b/django_pdb/management/commands/runserver.py @@ -54,10 +54,13 @@ def handle(self, *args, **options): pdb_option = options.pop('pdb') ipdb_option = options.pop('ipdb') - middleware = 'django_pdb.middleware.PdbMiddleware' + pdb_middleware = 'django_pdb.middleware.PdbMiddleware' + middleware = (settings.MIDDLEWARE + if hasattr(settings, 'MIDDLEWARE') + else settings.MIDDLEWARE_CLASSES) if ((pdb_option or settings.DEBUG) - and middleware not in settings.MIDDLEWARE_CLASSES): - settings.MIDDLEWARE_CLASSES += (middleware,) + and pdb_middleware not in middleware): + middleware += (pdb_middleware,) self.pm = options.pop('pm') if self.pm: