# Overriding form widget templates

**URL:** <https://forum.djangoproject.com/t/overriding-form-widget-templates/38561>\
**Category:** Templates & Frontend\
**Created:** [February 4, 2025, 5:40pm UTC](https://forum.djangoproject.com/t/overriding-form-widget-templates/38561 "2025-02-04T17:40:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![alexandremjacques](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/alexandremjacques/32/893_2.png) [@alexandremjacques](https://forum.djangoproject.com/u/alexandremjacques)\
**Post date:** [February 4, 2025, 5:40pm UTC](https://forum.djangoproject.com/t/overriding-form-widget-templates/38561/1 "2025-02-04T17:40:46Z")

</div>

Hi! In Django 5, is there a way to globally override widget templates?

In my use case, I have to create a different widget for file uploads, specially when displaying the file in templates (the default shows the current file with its path and a widget to upload a new file).

I tried to implement the final solution mentioned here: [Overriding Widgets templates not working (following help), template loader not searching app dirs - #10 by run\_the\_race](https://forum.djangoproject.com/t/overriding-widgets-templates-not-working-following-help-template-loader-not-searching-app-dirs/12974/10)

If try to customize the `templates/django/widgets/file.html` I don’t see any changes to my form upload fields (I can see that `file.html` just imports the `input.html` template and I can’t find where the template I see rendered is defined).

Is this even possible? Do I have to create a custom upload Field?

TIA

---

<div class="post-metadata">

**Author:** ![philgyford](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/philgyford/32/14295_2.png) [@philgyford](https://forum.djangoproject.com/u/philgyford)\
**Post date:** [February 4, 2025, 8:42pm UTC](https://forum.djangoproject.com/t/overriding-form-widget-templates/38561/2 "2025-02-04T20:42:39Z")

</div>

I think django-debug-toolbar will show you which templates are being used, which might help work out what’s going wrong.

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [February 5, 2025, 2:53am UTC](https://forum.djangoproject.com/t/overriding-form-widget-templates/38561/3 "2025-02-05T02:53:54Z")

</div>

> [@alexandremjacques](#):
>
> Hi! In Django 5, is there a way to globally override widget templates?

Yes, the (very short) information for this is at [Overriding built-in widget templates](https://docs.djangoproject.com/en/5.1/ref/forms/renderers/#overriding-built-in-widget-templates), along with the related information at [TemplatesSetting](https://docs.djangoproject.com/en/5.1/ref/forms/renderers/#templatessetting)

> [@alexandremjacques](#):
>
> If try to customize the `templates/django/widgets/file.html`

That’s the wrong location. That template is located in  
[`django/forms/widgets/file.html`](https://github.com/django/django/blob/stable/5.1.x/django/forms/templates/django/forms/widgets/file.html)  
(within the `templates` directory)

Also, did you make the other settings changes as described?
