I\'m using django built-in login forms and i want to add placeholders to username and password.
My template:
<
In response to your comment on the other answer. You can subclass the the Authentication form.
from django import forms
from django.contrib.auth.forms import AuthenticationForm
from django.forms.widgets import PasswordInput, TextInput
class PlaceholderAuthForm(AuthenticationForm):
username = forms.CharField(widget=TextInput(attrs={'placeholder': 'Email'}))
password = forms.CharField(widget=PasswordInput(attrs={'placeholder':'Password'}))
or see the other function that was put in this question. --> How can I override the django AuthenticationForm input css class?