1 2 3 4 5 6 7 8 | from django.conf.urls.defaults import *
from django.http import HttpResponsePermanentRedirect
def redirect(url):
def inner(request, **args):
redirect_to = '%s?%s' % (url % args, request.GET.urlencode())
return HttpResponsePermanentRedirect(redirect_to)
return inner
|
More like this
- Painless link to admin change view for a given object by david_bgk 4 years, 2 months ago
- general-purpose django XMLRC dispatcher by teepark 4 years, 3 months ago
- @url decorator - getting rid of urlpatterns by southern_sun 5 years, 8 months ago
- Simple Age Verification Middleware by eculver 3 years, 9 months ago
- Redirect to no slash by grillermo 1 year, 4 months ago
Comments