Back

Explore Courses Blog Tutorials Interview Questions

Explore Tech Questions and Answers

Welcome to Intellipaat Community. Get your technical queries answered by top developers!

0 votes
2 views
by (19.9k points)

How do I accomplish a simple redirect (e.g. cflocation in ColdFusion, or header(location:http://) for PHP) in Django?

1 Answer

0 votes
by (25.1k points)

In Django 1.5 redirect_to no longer exists and has been replaced by RedirectView.

from django.views.generic import RedirectView

urlpatterns = patterns('',

    (r'^one/$', RedirectView.as_view(url='/another/')),

)

Related questions

Browse Categories

...