Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Python by (19.9k points)
recategorized by

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

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...