def form_view(request):
    if request.method == 'POST':
        form = TestForm(request.POST)
        if form.is_valid():
            t = Template('Valid POST data.', name='Valid POST Template')
            c = Context()
        else:
            t = Template('Invalid POST data. {{ form.errors }}', name='Invalid POST Template')
            c = Context({'form': form})
    else:
        form = TestForm()
        t = Template('Viewing base form. {{ form }}.', name='Form GET Template')
        c = Context({'form': form})
    
    return HttpResponse(t.render(c))
A view that tests a simple form
dataset/ETHPy150Open CollabQ/CollabQ/.google_appengine/lib/django/tests/modeltests/test_client/views.py/form_view