django.http HttpResponsePermanentRedirect Python Code Examples

HttpResponsePermanentRedirect (source code) is a class in the Django code base for returning an HTTP 301 status code or a permanent URL redirect from your web application.

Note that you can import HttpResponsePermanentRedirect from either django.http.responses or django.http, because the latter one imports the responses from the responses.py file.

HttpResponsePermanentRedirect is often used in combination with django.conf.urls url.

Example 1 from django-angular

django-angular (project examples website) is a library with helper code to make it easier to use Angular as the front-end to Django projects. The code for django-angular is open source under the MIT license.

django-angular / djng / urls.py