Add: login forms

This commit is contained in:
Aroy-Art 2023-10-06 10:21:54 +02:00
parent 4af0881f65
commit ce13d4c5c5
Signed by: Aroy
GPG key ID: 583642324A1D2070

View file

@ -0,0 +1,55 @@
from django import forms
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.models import User
class LoginForm(forms.Form):
username = forms.CharField(
widget=forms.TextInput(
attrs={
"placeholder": "Username",
"class": "form-control"
}
))
password = forms.CharField(
widget=forms.PasswordInput(
attrs={
"placeholder": "Password",
"class": "form-control"
}
))
class SignUpForm(UserCreationForm):
username = forms.CharField(
widget=forms.TextInput(
attrs={
"placeholder": "Username",
"class": "form-control"
}
))
email = forms.EmailField(
widget=forms.EmailInput(
attrs={
"placeholder": "Email",
"class": "form-control"
}
))
password1 = forms.CharField(
widget=forms.PasswordInput(
attrs={
"placeholder": "Password",
"class": "form-control"
}
))
password2 = forms.CharField(
widget=forms.PasswordInput(
attrs={
"placeholder": "Password check",
"class": "form-control"
}
))
class Meta:
model = User
fields = ('username', 'email', 'password1', 'password2')