Skip to content

Instantly share code, notes, and snippets.

@gilsondev
Created May 25, 2012 19:29
Show Gist options
  • Save gilsondev/2790045 to your computer and use it in GitHub Desktop.
Save gilsondev/2790045 to your computer and use it in GitHub Desktop.
Using reverse function with Class based generic view in success_url
# -*- coding: utf8 -*-
from django.views.generic.edit import FormView
from django.core.urlresolvers import reverse
class FooFormView(FormView):
template_name = 'foo/foo_form.html'
form_class = FooForm
# (...)
def get_success_url(self):
return reverse('foo:form')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment