jazzband / django-debug-toolbar

A configurable set of panels that display various debug information about the current request/response.
https://django-debug-toolbar.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
7.97k stars 1.03k forks source link

README: Fix Django compatibility #1901

Closed marcelometal closed 2 months ago

marcelometal commented 2 months ago

HI, Semantic versioning says to not introduce breaking change without releasing a new major version.

Given a version number MAJOR.MINOR.PATCH, increment the:

MAJOR version when you make incompatible API changes MINOR version when you add functionality in a backward compatible manner PATCH version when you make backward compatible bug fixes Additional labels for pre-release and build metadata are available as extensions to the MAJOR.MINOR.PATCH format.

Drop Django 4 support in 4.3.0 is a breaking change.

In the future, please change the major version and not the minor version.

tim-schilling commented 2 months ago

The toolbar still supports django 4.2. I don't agree dropping support for release points necessitates bumping the major version. Django's release strategy means you should be able to upgrade from 4.0 to 4.1 to 4.2 relatively easily.

marcelometal commented 2 months ago

Hi @tim-schilling ,

After updating to 4.3.0:

Traceback (most recent call last):
  File "/home/user/.virtualenvs/blah/lib/python3.11/site-packages/django/core/handlers/exception.py", line 55, in inner
    response = get_response(request)
               ^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/.virtualenvs/blah/lib/python3.11/site-packages/debug_toolbar/middleware.py", line 69, in __call__
    panel.generate_stats(request, response)
  File "/home/user/.virtualenvs/blah/lib/python3.11/site-packages/debug_toolbar/panels/templates/panel.py", line 196, in generate_stats
    template_data["context_list"] = self.process_context_list(
                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/.virtualenvs/blah/lib/python3.11/site-packages/debug_toolbar/panels/templates/panel.py", line 137, in process_context_list
    if hasattr(value, "_wrapped"):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/.virtualenvs/blah/lib/python3.11/site-packages/material/base.py", line 136, in __getattr__
    container_size = int(container_size)
                     ^^^^^^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: 'wrapped'

My local dependencies:

tim-schilling commented 2 months ago

I don't think this is a valid PR given the toolbar supports v4.2, so I'm going to close it.

Regarding the exception, if you'd like help with debugging it, please create a minimal environment that reproduces the problem. As a note, it appears that https://github.com/viewflow/django-material was archived in February and is no longer maintained. The last supported version of Django looks to be v4.1.

marcelometal commented 2 months ago

I don't think this is a valid PR given the toolbar supports v4.2, so I'm going to close it.

Ok, but that bug only occurs when I use django-debug-toolbar 4.3.0

Regarding the exception, if you'd like help with debugging it, please create a minimal environment that reproduces the problem. As a note, it appears that https://github.com/viewflow/django-material was archived in February and is no longer maintained. The last supported version of Django looks to be v4.1.

I will try to create a minimal environment that reproduces the problem. But, as I said, installing django-debug-toolbar 4.2.0 there is no error.