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 uselabel` instead this:

field = forms.charfield(label="your_language_here") 

more info here.


Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -