In my settings.py I have set
FORM_RENDERER = 'django.forms.renderers.TemplatesSetting'
now in can add my own templates in:
<project>/templates/django/forms/widgets/
or
<app>/templates/django/forms/widgets/
this works great! However, what I can't find is where do I override the default html (form) label?
class TestForm(forms.Form):
first_name = forms.CharField(label="First name", max_length=50)
last_name = forms.CharField(label="Last name")
nick_name = forms.CharField(required=False)
The above form would render the labels like this:
<label for="id_first_name">First name:</label>
I want to render the label differently. So, I thought it would easy as adding a html label template: templates/django/forms/widgets/label.html
This doesn't work. Was going through the Django docs, but I can't find how to do this for labels. Apparently a label is not a widget.
https://docs.djangoproject.com/en/1.11/ref/forms/widgets/#built-in-widgets
My question, where/how do I change the default label?