def view(request):
from django import forms<EOL>from django.http import HttpResponse<EOL>from django.shortcuts import redirect<EOL>from django.template import Context, Template<EOL>class TestForm(forms.Form):<EOL><INDENT>name = forms.CharField()<EOL><DEDENT>if request.POST:<EOL><INDENT>form = TestForm(request.POST)<EOL>if form.is_valid():<EOL><INDENT>return redirect('<STR_LIT>')<EOL><DEDENT><DEDENT>else:<EOL><INDENT>form = TestForm()<EOL><DEDENT>template = Template("<STR_LIT>")<EOL>context = Context({'<STR_LIT>' : form})<EOL>return HttpResponse(template.render(context))<EOL>
Test view that returning form