Skip to content

Do not throw exception when template is missing #893

Open
@blueyed

Description

@blueyed

Currently you might end up not being able to access the admin etc in case the template is missing.

Code: https://github.com/jazzband/django-debug-toolbar/blob/f73b69e70800195576cb1a85512bc5197c659d85/debug_toolbar/toolbar.py#L56-L72.

I think it might be better to log the exception (logger.exception), and then just render nothing instead.

The case at hand is that the DDT is being enabled based on a user's group, and when the app was missing in INSTALLED_APPS (due to wrong settings), it caused the template to not being collected with collectstatic.
With the exception being thrown, it would not be possible to remove the user from the group again (without using the shell or fixing the settings in the code).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions