Monday, April 1, 2013

Re: djano user registration form and login(full example)

Don't even worry about factories. They're for when you want a bunch of
forms for the same model on the page at once.

Use the UserCreationForm in django.contrib.auth.forms. It only accepts
a username and password, so you can either subclass it to add the
fields or make your own form and add it to your view so that they both
appear in the same HTML form. You can validate both and do what you
need to do.

You definitely shouldn't be writing validation logic for the password
and username and such -- that's what ModelForms are for.

If you have more specific questions just ask.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment