Django - Django redirect directly in urls.py
Redirect a url to another url directly in the urls.py file using name matching.
Redirect a url to another url directly in the urls.py file using name matching.
Use class based RedirectView with url name parameter. Possibly use permanent=True for a permanent redirect.
from django.views.generic import RedirectView
urlpatterns = patterns('',
url(r'{{pattern}}', RedirectView.as_view(pattern_name='{{redirect_name}}')),
)
last update: