WIth django, can you do something similiar to user = User.new(params[:user]) during a form post?
in ruby/ror you can do this:
user = User.new(params[:user])
which populates a new object with the values from a posted form.
Can something similar be do开发者_如何学Gone using django/python?
Look at the model form documentation. Basically, the code would look like:
f = UserForm(request.POST or None)
user = f.save()
If you are talking about Django's built-in auth app, then keep in mind that there are a few considerations when creating users, such as passwords, unique usernames, etc
精彩评论