Back
How do I accomplish a simple redirect (e.g. cflocation in ColdFusion, or header(location:http://) for PHP) in Django?
In Django 1.5 redirect_to no longer exists and has been replaced by RedirectView.
from django.views.generic import RedirectViewurlpatterns = patterns('', (r'^one/$', RedirectView.as_view(url='/another/')),)
from django.views.generic import RedirectView
urlpatterns = patterns('',
(r'^one/$', RedirectView.as_view(url='/another/')),
)
31k questions
32.8k answers
501 comments
693 users