La version 5 de Planète Casio. Regroupe le forum, les programmes, les tutoriel, les sprites et tous les autres outils développés par nos soins.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

forms.py 1.2KB

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