1👍
You are returning a HttpResponse
object only if if request.method == 'POST':
But if the request method is __not POST
, you are not returning anything. You probably need to indent the code one level to the left.
def registerit(request):
if request.method == 'POST':
form = UserCreationForm(request.POST)
if form.is_valid():
form.save()
return HttpResponseRedirect('/accounts/register_success')
args = {'form3':UserCreationForm()}
args.update(csrf(request))
return render_to_response('register.html', args)
Source:stackexchange.com