So when I look on tutorials online on how to use the django built in login system I found that they use {{ form.as_p }}
in templates, how can I access each field individualy in tmeplates so I can put them in my own styled template ?
How to access djagno built in login system fields
288 Views Asked by Ahmed Mohsen At
2
There are 2 best solutions below
0
On
You can lookup login form field names from Django source code. Here - https://github.com/django/django/blob/master/django/contrib/auth/forms.py.
You can redefine fields by inheriting default
AuthenticationForm
In templates you can access these fileds as
{{ form.username }}
and{{ form.password }}
Also you can wrap each field in
<div>
tag and add some classes, for example: