Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#28945 closed Bug (wontfix)

widgets.Input should support non-app custom template_names

Reported by: Jonas Haag Owned by: nobody
Component: Forms Version: 2.0
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

If you make your own django.forms.widgets.Input subclass an overwrite the template_name argument, Django will only look in django/forms/templates/ and in your app dirs, but not in any templates defined in a settings.TEMPLATES[...]['DIRS'] dir.

class MyInput(widgets.Input):
    template_name = 'foo.html'

Even if I have spam/templates in DIRS, it won't look for spam/templates/foo.html.

We should at least document this.

Change History (2)

comment:1 Changed 4 years ago by Tim Graham

Component: UncategorizedForms
Resolution: wontfix
Status: newclosed

It sounds like you haven't read the existing documentation.

comment:2 Changed 4 years ago by Jonas Haag

Must have missed this. Sorry and thanks Tim!

Note: See TracTickets for help on using tickets.
Back to Top