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