I created a test repo
https://github.com/GuillaumeQuenneville/djangoform.git
Django finds home.html (parent template) but does not find the
item_form.html template in the same dir.
Adding the form template to the test app's local templates folder fixes
the discovery issue (rename item_form.html.bk -> item_form.html in repo)
As a test, I turned on the debugger before the render in the view. Calling
render(request, 'home.html') returns a 200 and no error, calling
form.render(template_name='home.html') says home.html not found, idem for
form.render() saying item_form.html not found. So there is a difference in
template discovery??
--
Ticket URL: <https://code.djangoproject.com/ticket/33345>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* cc: Guillaume Quenneville (added)
* component: Template system => Forms
--
Ticket URL: <https://code.djangoproject.com/ticket/33345#comment:1>
* cc: David Smith (added)
* status: new => closed
* resolution: => invalid
Comment:
`Form.render()` uses
[https://docs.djangoproject.com/en/4.0/ref/forms/api/#django.forms.Form.default_renderer
Form.default_renderer] when the `renderer` argument is not specified, and
`Form.default_renderer` defaults to the
[https://docs.djangoproject.com/en/4.0/ref/settings/#std:setting-
FORM_RENDERER FORM_RENDERER] setting which defaults to
[https://docs.djangoproject.com/en/4.0/ref/forms/renderers/#django.forms.renderers.DjangoTemplates
`'django.forms.renderers.DjangoTemplates'`]. If you want to render
templates with customizations from your `TEMPLATES` setting, you should
change the renderer to use the
[https://docs.djangoproject.com/en/4.0/ref/forms/renderers/#django.forms.renderers.TemplatesSetting
`TemplatesSetting`] renderer at any of these levels.
--
Ticket URL: <https://code.djangoproject.com/ticket/33345#comment:2>