Skip to content

Instantly share code, notes, and snippets.

@omarish
Created May 21, 2012 16:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save omarish/2763195 to your computer and use it in GitHub Desktop.
Save omarish/2763195 to your computer and use it in GitHub Desktop.
from foo.forms import MyForm
def myview(request):
form = MyForm()
if request.POST:
form = MyForm(request.POST)
if form.is_valid():
# Do something with the contents, perhaps save the form
form.save() # You can call this sometimes.
return render_to_response("success page...", {})
return render_to_response("original page with form", {
'form': form
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment