Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

django-content-settings and django-debug-toolbar conflict #128

Open
richardbrockie opened this issue Dec 23, 2024 · 0 comments
Open

django-content-settings and django-debug-toolbar conflict #128

richardbrockie opened this issue Dec 23, 2024 · 0 comments

Comments

@richardbrockie
Copy link

Hi,

I've come across what might be a new conflict. I'm sure this was working fine some months ago with earlier versions. Is there something I'm doing wrong?

Python==3.11.10
Django==4.2.17
django-debug-toolbar==4.4.6
django-content-settings==0.29.1

When I am use django-debug-toolbar in development together with django-content-settings I get the following error when loading any page in my django app:

Internal Server Error: /
Traceback (most recent call last):
  File "/Users/richard/VirtualEnvs/ontheday_heroku_v3.11.10/lib/python3.11/site-packages/django/core/handlers/exception.py", line 55, in inner
    response = get_response(request)
               ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/richard/VirtualEnvs/ontheday_heroku_v3.11.10/lib/python3.11/site-packages/debug_toolbar/middleware.py", line 92, in __call__
    panel.generate_stats(request, response)
  File "/Users/richard/VirtualEnvs/ontheday_heroku_v3.11.10/lib/python3.11/site-packages/debug_toolbar/panels/templates/panel.py", line 201, in generate_stats
    template_data["context_list"] = self.process_context_list(
                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/richard/VirtualEnvs/ontheday_heroku_v3.11.10/lib/python3.11/site-packages/debug_toolbar/panels/templates/panel.py", line 142, in process_context_list
    if hasattr(value, "_wrapped"):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/richard/VirtualEnvs/ontheday_heroku_v3.11.10/lib/python3.11/site-packages/content_settings/conf.py", line 364, in __getattr__
    prefix, name, suffix = split_attr(value)
                           ^^^^^^^^^^^^^^^^^
  File "/Users/richard/VirtualEnvs/ontheday_heroku_v3.11.10/lib/python3.11/site-packages/content_settings/conf.py", line 149, in split_attr
    assert name.isupper(), f"Invalid attribute name: {value}; name should be uppercase"

Link to django-debug-toolbar: https://django-debug-toolbar.readthedocs.io/en/latest/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant