Hi Brad,

If you are using FormView, then you can set the success_url as mentioned in 
the 
docs<https://docs.djangoproject.com/en/dev/ref/class-based-views/mixins-editing/#django.views.generic.edit.FormMixin.success_url>
.

Cheers,
Arun

On Saturday, January 11, 2014 1:06:56 AM UTC+5:30, Brad Rice wrote:
>
> I can't seem to find success using success_url
>
> If I try this in my urls.py file
>
> url(r'^step2/', AnswersCreate.as_view(success_url='/requestform/success'), 
> name='answers'),
>
> and then in my view:
>
> def form_valid(self, form):
>         obj = form.save(commit=False)
>         obj.created_by = self.request.user
>         obj.save()
>         return HttpResponseRedirect(self.get_success_url())
>
> I get a successful save but it does not take me to the next url defined in 
> success_url
>
> Is there another way to do it, or what am I doing wrong?
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/35cc977f-a0f7-453c-9523-d22f82a0acd2%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to