Created
September 4, 2014 02:20
-
-
Save toastdriven/31e059c2c0a33c83a8bc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.shortcuts import redirect, render | |
def my_view(request): | |
if request.method == 'POST': | |
form = MyForm(request.POST) | |
if form.is_valid(): | |
# Save some data then... | |
return redirect('view-name-here', kwargs_go=here) | |
else: | |
form = MyForm() | |
return render(request, 'template/name.html', { | |
'form': form, | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment