Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django user registration form best practices

Tags:

python

django

Django way of customizing the user creation is by adding UserProfile model, however when I am performing user registration, I would like the user to fill all the details, including the ones in the user profile as well.

Using forms.ModelForm seems like the easiest way, however I am dealing here with two models. What is the easiest way to accomplish that?

Thanks

like image 256
reshefm Avatar asked Mar 30 '11 13:03

reshefm


3 Answers

UserCreationForm may come in handy.

like image 173
Stephen Paulger Avatar answered Oct 10 '22 20:10

Stephen Paulger


Found the answer: http://uswaretech.com/books/djangodesignpatterns/misc.html#saving-multiple-objects-in-one-form

like image 31
reshefm Avatar answered Oct 10 '22 20:10

reshefm


Have a look at this too: http://docs.djangoproject.com/en/dev/topics/forms/formsets/

like image 25
Timmy O'Mahony Avatar answered Oct 10 '22 22:10

Timmy O'Mahony