Redirect request django

Using the Django authentication system ... from django.contrib.auth import logout def logout_view (request): logout (request) # Redirect to a success page. #django IRC channel Writing your first Django app, part 4; Getting help FAQ Try the FAQ — it's got answers to many common questions. Use the HttpResponsePermanentRedirect response object if you instead want to return a 301 permanent redirect … The Django Software Foundation deeply values the diversity of our developers, users, and community. In this article, we go over how to redirect to another page in Django.

So, if a user types in a certain URL into a web browser or clicks a submit button of a form and you want the person to be redirected to another page, this can be easily done in Django. HttpResponseRedirect is a subclass of HttpResponse (source code) in the Django web framework that returns the HTTP 302 status code, indicating the URL resource was found but temporarily moved to a different URL.This class is most frequently used as a return object from a Django view. Note that logout() doesn’t throw any errors if the user wasn’t logged in. How to Redirect to Another Page in Django. Index, Module Index, or Table of Contents Handy when looking for specific information.

django-users mailing list Search for information in the archives of the django-users mailing list, or post a question.