Skip to content

Feature: add show_template_paths management command #1933

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

benbacardi
Copy link

This PR adds a management command show_template_paths that lists the full, absolute file system paths that are searched by the template loader when loading templates, in the order they are searched.

This is useful when debugging "template not found" errors, used in conjunction with the existing find_template management command.

$ python manage.py show_template_paths
/Users/joe.smith/my_project/templates
/Users/joe.smith/Library/Caches/pypoetry/virtualenvs/test_venv-py3.13/lib/python3.13/site-packages/django/contrib/admin/templates
/Users/joe.smith/Library/Caches/pypoetry/virtualenvs/test_venv-py3.13/lib/python3.13/site-packages/django/contrib/auth/templates
/Users/joe.smith/Library/Caches/pypoetry/virtualenvs/test_venv-py3.13/lib/python3.13/site-packages/django_extensions/templates
/Users/joe.smith/my_project/my_app/templates

@benbacardi benbacardi force-pushed the show_template_paths branch from d5cb669 to 7c26465 Compare May 6, 2025 10:03
@trbs
Copy link
Member

trbs commented May 15, 2025

rebasing will solve the build issues

@benbacardi benbacardi force-pushed the show_template_paths branch 2 times, most recently from 3425282 to 4eeda43 Compare May 15, 2025 15:30
@benbacardi benbacardi force-pushed the show_template_paths branch from 355a329 to 708e707 Compare May 20, 2025 09:27
BASE_DIR = Path(__file__).resolve().parent.parent.parent.parent


class ShowPermissionsTests(TestCase):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please fix the name :-)

@trbs
Copy link
Member

trbs commented Jun 17, 2025

Could you please fix the issues with the tests?

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 this pull request may close these issues.

2 participants