Skip to content

Viewing a template gives a 500 error #2127

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

Closed
jwells80 opened this issue Apr 17, 2025 · 2 comments
Closed

Viewing a template gives a 500 error #2127

jwells80 opened this issue Apr 17, 2025 · 2 comments

Comments

@jwells80
Copy link

jwells80 commented Apr 17, 2025

I'm getting the following error when trying to view any template via the DJango Debug Toolbar.

Traceback (most recent call last):
File "/usr/local/lib/python3.13/site-packages/django/core/handlers/exception.py", line 55, in inner
    response = get_response(request)
File "/usr/local/lib/python3.13/site-packages/django/core/handlers/base.py", line 197, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/usr/local/lib/python3.13/site-packages/debug_toolbar/decorators.py", line 34, in inner
    return view(request, *args, **kwargs)
File "/usr/local/lib/python3.13/site-packages/debug_toolbar/decorators.py", line 46, in inner
    return view(request, *args, **kwargs)
File "/usr/local/lib/python3.13/site-packages/debug_toolbar/panels/templates/views.py", line 45, in template_source
    source = loader.get_contents(origin)
File "/usr/local/lib/python3.13/site-packages/django/template/loaders/cached.py", line 26, in get_contents
    return origin.loader.get_contents(origin)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'get_contents'```

@matthiask
Copy link
Member

Are you using django-template-partials or some other package which adds more template loaders by chance?

If so: This is probably already fixed but not released yet, see #2117

@jwells80
Copy link
Author

Yes, I'm using django-template-partials. Thanks for the quick update. I'll watch for this to be released.

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

2 participants