1👍
To follow up my last comment with some code… at least start with this:
def register_user(request):
args = {}
args.update(csrf(request))
if request.method == 'POST':
form = MyRegistrationForm(request.POST)
if form.is_valid():
print "Is valid"
form.save()
return HttpResponseRedirect('/register_success/')
else:
print "Is invalid"
args = {}
args.update(csrf(request))
args['form'] = form
else:
args = {}
args.update(csrf(request))
args['form'] = MyRegistrationForm()
return render_to_response('register.html', args, context_instance=RequestContext(request))
I’m not proud of the conditional hierarchy / dup code but it ought to do the job.
Source:stackexchange.com