-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
False postive for debug_toolbar.W006 when manually declaring cached template loader. #1780
Comments
Hey Thanks for the reoprt! This came up already; if See https://docs.djangoproject.com/en/4.2/releases/1.11/#miscellaneous
We probably should still fix this but it has been declared as low priority in the past. |
Yep, agreed. I don't think it's a biggie. (It's pretty niche.) Current work around is:
(I may be able to swing to it at some point, soonish) |
Yes, or you (or any readers of this issue, not writing this for you specifically but for those who are drive-by-copy-pasting) could remove the This would be sufficient: TEMPLATES = [
{
"BACKEND": "django.template.backends.django.DjangoTemplates",
"DIRS": [],
"APP_DIRS": True,
"OPTIONS": {
"context_processors": [
"django.template.context_processors.debug",
"django.template.context_processors.request",
"django.contrib.auth.context_processors.auth",
"django.contrib.messages.context_processors.messages",
],
},
},
] (It's what I use these days.) |
Yep 👍. Since the autoreloader support for templates was added in Django 4.1, the cached loader is used in development too. As such, there's almost no need to declare loaders for the majority case. (I'm only doing it myself because I'm tweaking...) |
…d template loaders. Django's cached loader wraps a list of child loaders, which may correctly contain the required app directories loader.
…d template loaders. Django's cached loader wraps a list of child loaders, which may correctly contain the required app directories loader.
Hi.
Manually declare template loaders, using the cached loader:
The DDT
APP_DIRS
check then gives a false positive:In:
https://github.com/jazzband/django-debug-toolbar/blob/de7e19c5ef08445ca592c75dfa3dad22c04992a1/debug_toolbar/apps.py#L26
It looks like checking for and walking
loader.loaders
would resolve this. 🤔The text was updated successfully, but these errors were encountered: