Files
eventify_backend/accounts/forms.py

28 lines
797 B
Python
Raw Normal View History

2025-11-27 11:53:46 +05:30
from django import forms
from django.contrib.auth.forms import UserCreationForm
2025-11-28 03:11:38 +05:30
from django.contrib.auth.forms import AuthenticationForm
2025-11-27 11:53:46 +05:30
from .models import User
from django import forms
2025-11-27 11:53:46 +05:30
2025-11-28 03:11:38 +05:30
class UserForm(AuthenticationForm):
2025-11-28 03:11:38 +05:30
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
for field in self.fields.values():
field.widget.attrs.update({"class": "form-control"})
2025-11-28 03:11:38 +05:30
2025-11-27 11:53:46 +05:30
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"
})
)