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

Jinja2 dependency breaks default install #1949

Closed
danjac opened this issue Jul 5, 2024 · 1 comment · Fixed by #2027
Closed

Jinja2 dependency breaks default install #1949

danjac opened this issue Jul 5, 2024 · 1 comment · Fixed by #2027

Comments

@danjac
Copy link
Contributor

danjac commented Jul 5, 2024

Version: 4.4.4
Django version: 5.0.6

Default toolbar settings

On startup Django crashes:

File "/my-project/.venv/lib/python3.12/site-packages/debug_toolbar/panels/templates/__init__.py", line 1, in <module>
    from debug_toolbar.panels.templates.panel import TemplatesPanel
  File "/my-project/.venv/lib/python3.12/site-packages/debug_toolbar/panels/templates/panel.py", line 17, in <module>
    from debug_toolbar.panels.templates.jinja2 import patch_jinja_render
  File "/my-project/.venv/lib/python3.12/site-packages/debug_toolbar/panels/templates/jinja2.py", line 3, in <module>
    from django.template.backends.jinja2 import Template as JinjaTemplate
  File "/my-project/.venv/lib/python3.12/site-packages/django/template/backends/jinja2.py", line 3, in <module>
    import jinja2
ModuleNotFoundError: No module named 'jinja2'

It looks like jinja2 is required for the TemplatesPanel - in my project this is not a dependency. Either jinja2 is included as a dependency, or we check it is present, or the requirement is documented.

@danjac danjac changed the title Jinja2 dependency break default install Jinja2 dependency breaks default install Jul 5, 2024
matthiask added a commit to matthiask/django-debug-toolbar that referenced this issue Jul 5, 2024
@matthiask
Copy link
Member

Thanks for the report! #1954 hopefully fixes this.

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

Successfully merging a pull request may close this issue.

2 participants