Skip to content

Instantly share code, notes, and snippets.

@dstanek
Forked from anonymous/gist:4381219
Last active December 10, 2015 04:28
Show Gist options
  • Save dstanek/4381225 to your computer and use it in GitHub Desktop.
Save dstanek/4381225 to your computer and use it in GitHub Desktop.
from myapp.forms import MyForm
def my_view(request):
form = MyForm(request.POST or None)
if form.is_valid():
name = form.cleaned_data['name']
email = form.cleaned_data['email']
# do something great with that data
return render(request, 'myapp/myform.html', {
'form': form
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment