Skip to content

After upgrading to Django 4.2 LTS, I receive AttributeError on each page load. Using DDT 4.0.0 #1769

Closed
@kunambi

Description

@kunambi
E0506 14:25:32.246 django.request:241 Internal Server Error: /dashboard/
Traceback (most recent call last):
  File "C:\Users\Owner\.virtualenvs\premind-6P0nJig8\lib\site-packages\django\core\handlers\exception.py", line 55, in inner
    response = get_response(request)
  File "C:\Users\Owner\.virtualenvs\premind-6P0nJig8\lib\site-packages\sentry_sdk\integrations\django\middleware.py", line 176, in __call__
    return f(*args, **kwargs)
  File "C:\Users\Owner\.virtualenvs\premind-6P0nJig8\lib\site-packages\debug_toolbar\middleware.py", line 64, in __call__
    panel.disable_instrumentation()
  File "C:\Users\Owner\.virtualenvs\premind-6P0nJig8\lib\site-packages\debug_toolbar\panels\cache.py", line 217, in disable_instrumentation
    self._unmonkey_patch_cache(cache)
  File "C:\Users\Owner\.virtualenvs\premind-6P0nJig8\lib\site-packages\debug_toolbar\panels\cache.py", line 171, in _unmonkey_patch_cache
    if original_method.__func__ == getattr(cache.__class__, name):
AttributeError: 'function' object has no attribute '__func__'

Commenting debug_toolbar.panels.cache.CachePanel allows DDT to continue to work.

# settings.py
MIDDLEWARE = [
    "django.middleware.gzip.GZipMiddleware",
]

if DEBUG_TOOLBAR:
    INSTALLED_APPS += ["debug_toolbar"]
    MIDDLEWARE += ["debug_toolbar.middleware.DebugToolbarMiddleware"]
    DEBUG_TOOLBAR_PANELS = [
        "debug_toolbar.panels.history.HistoryPanel",
        "debug_toolbar.panels.versions.VersionsPanel",
        "debug_toolbar.panels.timer.TimerPanel",
        "debug_toolbar.panels.settings.SettingsPanel",
        "debug_toolbar.panels.headers.HeadersPanel",
        "debug_toolbar.panels.request.RequestPanel",
        "debug_toolbar.panels.sql.SQLPanel",
        # 'debug_toolbar.panels.staticfiles.StaticFilesPanel',  # breaks if minio is enabled
        "debug_toolbar.panels.templates.TemplatesPanel",
        # "debug_toolbar.panels.cache.CachePanel",  # commenting this line allows DDT to continue to work
        "debug_toolbar.panels.signals.SignalsPanel",
        "debug_toolbar.panels.logging.LoggingPanel",
        "debug_toolbar.panels.redirects.RedirectsPanel",
        "debug_toolbar.panels.profiling.ProfilingPanel",
    ]

Please let me know if you need any more information in order to solve this issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions