Neat one off redirect

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

  1. Internet Explorer Redirect Decorator by johnboxall 5 years, 6 months ago
  2. HttpResponseRedirectView - Redirect to a view by adamlofts 5 years, 8 months ago
  3. View Redirect Decorators by bryanpieper 3 years, 9 months ago
  4. django redirects middleware a bit more fleixble by robertrv 4 years, 5 months ago
  5. Middelware to remember sql query log from before a redirect by miracle2k 6 years, 7 months ago

Comments

adamlofts (on September 11, 2008):

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?

#

(Forgotten your password?)