HassenPy / django-pdb

Gives you `manage.py runserver --pdb` and `manage.py test --pdb`
394 stars 61 forks source link

'PdbMiddleware' object is not callable #36

Closed rafaelcapucho closed 7 years ago

rafaelcapucho commented 7 years ago

Hello

Traceback (most recent call last):
  File "/usr/local/lib/python3.5/site-packages/django/core/handlers/exception.py", line 39, in inner
    response = get_response(request)
TypeError: 'PdbMiddleware' object is not callable

Django: 1.10.3 / Django-Pdb: 0.5.1

INSTALLED_APPS = [
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'devices',
    'rest_framework',
    'django_pdb'
]
MIDDLEWARE = [
    'django.middleware.security.SecurityMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
    'django_pdb.middleware.PdbMiddleware',
]

Thank you

tomchristie commented 7 years ago

I'm no longer maintaining this project. Please do feel free to update this thread if you resolve the issue or discover what the problem is.

yeraydiazdiaz commented 7 years ago

38 fixes this issue but you need to move django_pdb in your INSTALLED_APPS towards the top, as described in the README

For Django before 1.7 it needs to be added AFTER any apps that override the runserver or test commands (includes south and django.contrib.staticfiles).

For Django after 1.7 it needs to be added BEFORE them.