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.
For more options, visit https://groups.google.com/d/optout.

Reply via email to