Skip to content

django-template-partials and the templates panel do not work well together it seems #2109

Open
@matthiask

Description

@matthiask

Loading template sources crashes:

[19/Mar/2025 11:06:46] "GET /__debug__/render_panel/?store_id=f32af068303746c588911011cbf7da3f&panel_id=TemplatesPanel HTTP/1.1" 200 249515
Internal Server Error: /__debug__/template_source/
Traceback (most recent call last):
  File ".../.venv/lib/python3.12/site-packages/django/core/handlers/exception.py", line 55, in inner
    response = get_response(request)
               ^^^^^^^^^^^^^^^^^^^^^
  File ".../.venv/lib/python3.12/site-packages/django/core/handlers/base.py", line 197, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../projects/django-debug-toolbar/debug_toolbar/decorators.py", line 34, in inner
    return view(request, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../projects/django-debug-toolbar/debug_toolbar/decorators.py", line 46, in inner
    return view(request, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../projects/django-debug-toolbar/debug_toolbar/panels/templates/views.py", line 45, in template_source
    source = loader.get_contents(origin)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../.venv/lib/python3.12/site-packages/django/template/loaders/cached.py", line 27, in get_contents
    return origin.loader.get_contents(origin)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'get_contents'

(The strange debug toolbar paths are there because I use an editable install)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions