Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 0437399511
Fetching contributors…

Cannot retrieve contributors at this time

25 lines (20 sloc) 0.78 kb
from django import forms
from django.contrib.auth.models import User
class RegistrationForm(forms.Form):
username = forms.CharField(max_length=255)
email = forms.EmailField()
password = forms.CharField(
max_length=255,
widget=forms.PasswordInput(render_value=False))
password_confirm = forms.CharField(
max_length=255,
widget=forms.PasswordInput(render_value=False))
class Meta:
model = User
def clean(self):
super(self.__class__, self).clean()
password = self.cleaned_data['password']
password_confirm = self.cleaned_data['password_confirm']
if not password == password_confirm:
raise forms.ValidationError('Passwords do not match.')
return self.cleaned_data
Jump to Line
Something went wrong with that request. Please try again.