python - Django - how to override form template tag in html -
i working on project not in english language. have encountered little problem during registration.
in registration html have :
... <form action="" style="text-align: center" method="post">{% csrf_token %} <ul style = "text-align: left"> {{user_form.as_p}} </ul> <input type="submit" value="uÅūsiregistruoti" onclick="validateform()"/> </form> ...
and text default in english. {{user_form.as_p}}
takes values forms.py:
... fields = ('username', 'password1', 'password2') ...
is there way leave forms values unchanged, , rewrite html part in own language? how do that? cant take generated parts of html , translate it, wont work way.
you can use verbose_name
in model
this:
field = models.charfield(max_length=200, verbose_name="your_language_here")
more info see here
if form
didn't come 'model, can use
label` instead this:
field = forms.charfield(label="your_language_here")
more info here.