1 2 3 4 5 | from django.http import HttpResponseRedirect
urlpatterns += patterns('',
(r'^my_url$', lambda r: HttpResponseRedirect('http://www.google.com'))
)
|
More like this
- View Redirect Decorators by bryanpieper 2 years, 10 months ago
- FlatPageOverrideMiddleware by David 4 years, 5 months ago
- Decorator to ease dynamic redirections in Django by david_bgk 4 years, 3 months ago
- @url decorator - getting rid of urlpatterns by southern_sun 5 years, 8 months ago
- HttpResponseRedirectView - Redirect to a view by adamlofts 4 years, 9 months ago
Comments
Why not just use django.views.generic.simple.redirect_to?
#
I wasn't aware of redirect_to which works equally well.
Having said that: the method above is a little more pleasing colour-wise in my editor and perhaps more intuitive?
#