Django widget template override does not search in the project template directory. How to fix?
问题 I am attempting to override a built in widget template in Django 1.11. I seem to be doing everything that the docs say to do in this regard, but for the widget templates, Django is not looking in my project at all, and I get a TemplateDoesNotExist error. Here's what I have for the override: class MyFileWidget(widgets.FileInput): template_name = 'myapp/my_file_widget.html' The template is definitely there. If I pass the template to a render call, it finds it fine. Problem is an issue of paths.