I think in those cases you would need to add some custom logic to your view
to check whether the URL is valid for the "step" the user is in the
workflow.

On Fri, Oct 10, 2014 at 10:47 AM, robert brook <software.by.pyt...@gmail.com
> wrote:

> I know how to detect an ajax request.
>
> I am interested int the general issue of the user typing in a valid url
> for the application, but not appropriate for the particular workflow.
>
> I utilize the @login_required decorater.
>
>  I am looking for an analgous function to pass the user back to an
> appropriate page.
>
>
>
> On Friday, October 10, 2014 8:35:47 AM UTC-4, Collin Anderson wrote:
>>
>> Do you mean ajax-only?
>>
>> def my_view(request):
>>     if not request.is_ajax():
>>         return redirect('/a-valid-page/')
>>
>> https://docs.djangoproject.com/en/1.7/ref/request-response/#django.http.
>> HttpRequest.is_ajax
>>
>  --
> 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 django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> 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/00884451-604a-4ac1-99d1-860f6080c366%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/00884451-604a-4ac1-99d1-860f6080c366%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
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/CALn3ei2hSCD99_PK03StdO2%2BnxEZQqnoZ49ZpPGO%3DwAq6BFLwA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to