def test_redirect(request): if request.method == 'POST': form = TestForm(request.POST) if form.is_valid(): return HttpResponseRedirect('/lorem-ipsum') else: form = TestForm() extra = dict(title='Redirect', form=form) return render_to_response('foundry/test_form.html', extra, context_instance=RequestContext(request))
def test_plain_response(request): if request.method == 'POST': form = TestForm(request.POST) if form.is_valid(): return HttpResponse('Success') else: form = TestForm() extra = dict(title='Plain', form=form) return render_to_response('foundry/test_form.html', extra, context_instance=RequestContext(request))