The redirects app
The redirects app
Django comes with an optional redirects application. It lets you store simple redirects in a database and handles the redirecting for you. It uses the HTTP response status code 301 Moved Permanently
by default.
Installation
To install the redirects app, follow these steps:
- Ensure that the
django.contrib.sites
framework is installed. - Add
'django.contrib.redirects'
to yourINSTALLED_APPS
setting. - Add
'django.contrib.redirects.middleware.RedirectFallbackMiddleware'
to your 登录查看完整内容