from django import forms from django.contrib.auth.forms import UserCreationForm from django.contrib.auth.forms import AuthenticationForm from .models import User from django import forms class UserForm(AuthenticationForm): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) for field in self.fields.values(): field.widget.attrs.update({"class": "form-control"}) class LoginForm(AuthenticationForm): username = forms.CharField( widget=forms.TextInput(attrs={ "class": "form-control", "placeholder": "Enter username" }) ) password = forms.CharField( widget=forms.PasswordInput(attrs={ "class": "form-control", "placeholder": "Enter password" }) )