barseghyanartur / django-debug-toolbar-force

Show Django Debug Toolbar in non- or partial-HTML views.
https://pypi.python.org/pypi/django-debug-toolbar-force
14 stars 5 forks source link

TypeError: object() takes no parameters on django 1.11 #2

Closed guglielmo closed 6 years ago

guglielmo commented 6 years ago

I am on django 1.11.10, the debug toolbar is configured in the settings (DEBUG_TOOLBAR is True):

# TOOLBAR CONFIGURATION
# See: http://django-debug-toolbar.readthedocs.org/en/latest/installation.html#explicit-setup
if DEBUG_TOOLBAR:
    INSTALLED_APPS += (
        'debug_toolbar',
    )

    MIDDLEWARE += (
        'debug_toolbar.middleware.DebugToolbarMiddleware',
        'debug_toolbar_force.middleware.ForceDebugToolbarMiddleware',
    )

    DEBUG_TOOLBAR_PATCH_SETTINGS = False

    # http://django-debug-toolbar.readthedocs.org/en/latest/installation.html
    INTERNAL_IPS = env(
        'DEBUG_TOOLBAR_INTERNAL_IPS',
        default='127.0.0.1'
    ).split(',')
# END TOOLBAR CONFIGURATION

When starting the server I get:

Traceback (most recent call last):
Django version 1.11.10, using settings 'project.settings'
Starting development server at http://127.0.0.1:8000/
  File "/Users/gu/Workspace/op-politiche-2018/venv/lib/python3.6/site-packages/django/utils/autoreload.py", line 228, in wrapper
    fn(*args, **kwargs)
Quit the server with CONTROL-C.
  File "/Users/gu/Workspace/op-politiche-2018/venv/lib/python3.6/site-packages/django/core/management/commands/runserver.py", line 147, in inner_run
    handler = self.get_handler(*args, **options)
  File "/Users/gu/Workspace/op-politiche-2018/venv/lib/python3.6/site-packages/django/contrib/staticfiles/management/commands/runserver.py", line 28, in get_handler
    handler = super(Command, self).get_handler(*args, **options)
  File "/Users/gu/Workspace/op-politiche-2018/venv/lib/python3.6/site-packages/django/core/management/commands/runserver.py", line 68, in get_handler
    return get_internal_wsgi_application()
  File "/Users/gu/Workspace/op-politiche-2018/venv/lib/python3.6/site-packages/django/core/servers/basehttp.py", line 47, in get_internal_wsgi_application
    return import_string(app_path)
  File "/Users/gu/Workspace/op-politiche-2018/venv/lib/python3.6/site-packages/django/utils/module_loading.py", line 20, in import_string
    module = import_module(module_path)
  File "/usr/local/Cellar/python3/3.6.4_2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/Users/gu/Workspace/op-politiche-2018/wsgi.py", line 30, in <module>
    application = get_wsgi_application()
  File "/Users/gu/Workspace/op-politiche-2018/venv/lib/python3.6/site-packages/django/core/wsgi.py", line 14, in get_wsgi_application
    return WSGIHandler()
  File "/Users/gu/Workspace/op-politiche-2018/venv/lib/python3.6/site-packages/django/core/handlers/wsgi.py", line 151, in __init__
    self.load_middleware()
  File "/Users/gu/Workspace/op-politiche-2018/venv/lib/python3.6/site-packages/django/core/handlers/base.py", line 82, in load_middleware
    mw_instance = middleware(handler)
TypeError: object() takes no parameters

This is wht I have in the requirements:

# django
django==1.11.10
django-cors-headers==2.1.0
django-extensions==1.9.9
django-environ>=0.3
django-debug-toolbar
django-debug-toolbar-force

# PostgreSQL
psycopg2-binary==2.7.4

# Utilities
requests
pandas
xlrd
luzik commented 6 years ago

same here

barseghyanartur commented 6 years ago

@guglielmo, @luzik:

Thanks for reporting this. I'll check it ASAP.

epineda commented 6 years ago

Hi @barseghyanartur ! when you will pull this patch and release a new version of django-debug-toolbar-force? thank you a lot.

barseghyanartur commented 6 years ago

@epineda:

Thanks for reminding. I'll do it today.

barseghyanartur commented 6 years ago

@guglielmo, @luzik, @epineda:

Released in 0.1.4. Sorry for the dalay.

epineda commented 6 years ago

thank you again @barseghyanartur !!

:)