Custom Form Template configuration

Maybe I am failing to understand something…
In the docs it says that if you want to use a custom form template, you either create a renderer and configure it in the settings or you just put the path to the template in the form class as “template_name”.

What I am failing to understand is:

  1. is it only for the Form class, or ModelForm also has it?
  2. When I point to the path “template_name”, do I have to specify the renderer?

It somehow remains a mystery in the docs.

In my case, I provide a path to the template_name in MyForm(ModelForm) but Django raises TemplateDoesNotExist and in the logs it is giving paths only to site-packages in venv and not in the template directory.
I tried using the render method but again it failed.

Is this feature available for ModelForms.

For clarity - A ModelForm is a Form, with some additional functionality. Anything you can do in a Form can be done with a ModelForm.

You don’t “point to the path”, you’re referencing a template by name.

See the docs at