From ce13d4c5c596d38a46e745ccc6d0e11bc9ffe536 Mon Sep 17 00:00:00 2001 From: Aroy-Art Date: Fri, 6 Oct 2023 10:21:54 +0200 Subject: [PATCH] Add: login forms --- archivist/apps/authentication/forms.py | 55 ++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 archivist/apps/authentication/forms.py diff --git a/archivist/apps/authentication/forms.py b/archivist/apps/authentication/forms.py new file mode 100644 index 0000000..680a310 --- /dev/null +++ b/archivist/apps/authentication/forms.py @@ -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')