Files
eventify_backend/accounts/forms.py
2025-11-28 16:03:23 +05:30

28 lines
797 B
Python

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"
})
)