initialize project documentation and setup instructions

This commit is contained in:
itsmeabimanyu
2026-03-01 07:03:16 +07:00
parent df7071f519
commit 6fdf9d5b62
146 changed files with 89855 additions and 1 deletions

34
apps/core/forms.py Normal file
View File

@@ -0,0 +1,34 @@
from .models import CustomUserLogin
from django.contrib.auth.forms import UserCreationForm
class RegisterForm(UserCreationForm):
class Meta:
model = CustomUserLogin
fields = ['username', 'first_name', 'last_name', 'email']
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
placeholders = {
'username': 'Choose a unique username',
'first_name': 'Enter your first name',
'last_name': 'Enter your last name (optional)',
'email': 'example@email.com',
'password1': 'Create a strong password',
'password2': 'Repeat your password',
}
for field_name, field in self.fields.items():
if field_name == 'last_name':
field.required = False
else:
field.required = True
if field_name in placeholders:
field.widget.attrs.update({'placeholder': placeholders[field_name]})
field.widget.attrs.update({
'class': 'form-control mt-2 mb-2',
'autocomplete': 'off'
})