#-*- coding: utf-8 -*- from django.conf import settings from django import forms class LoginForm(forms.Form): # no need for max_length, let's not make heavyer things that can be lighter username = forms.CharField(label="", widget=forms.TextInput(attrs={'placeholder':'Identifiant'})) password = forms.CharField(label="", widget=forms.PasswordInput(attrs={'placeholder':'Mot de passe'})) class InscriptionForm(forms.Form): username = forms.CharField(label="Nom d'utilisateur", min_length=settings.USERNAME_MIN_LENGTH, max_length=settings.USERNAME_MAX_LENGTH) email = forms.EmailField(label="E-mail") # Should we silently truncate password or fix maximum length ? Here is a good answer : # https://security.stackexchange.com/questions/152430/what-maximum-password-length-to-choose-when-using-bcrypt password1 = forms.CharField(label="Mot de passe", min_length=settings.PASSWORD_MIN_LENGTH, max_length=settings.PASSWORD_MAX_LENGTH, widget=forms.PasswordInput) password2 = forms.CharField(label="Confirmer mot de passe", min_length=settings.PASSWORD_MIN_LENGTH, max_length=settings.PASSWORD_MAX_LENGTH, widget=forms.PasswordInput) cgu = forms.BooleanField(label="J'ai lu et j'accepte les conditions générales d'utilisations", initial=False)