Hi, I've recently discovered the possibility to add a `reason` to a redirect.
It's extremely useful for testing or debugging when a redirect to a same page can have different causes. I'm proposing to add this functionality to `django.shortcuts.redirect` : def redirect(to, *args, reason=None, permanent=False, **kwargs): """ Return an HttpResponseRedirect to the appropriate URL for the arguments passed. The arguments could be: * A model: the model's `get_absolute_url()` function will be called. * A view name, possibly with arguments: `urls.reverse()` will be used to reverse-resolve the name. * A URL, which will be used as-is for the redirect location. Issues a temporary redirect by default; pass permanent=True to issue a permanent redirect. a redirect reason can be specified using the `reason` optional parameter """ redirect_class = HttpResponsePermanentRedirect if permanent else HttpResponseRedirect return redirect_class(resolve_url(to, *args, **kwargs), reason=reason) It does not affect any previous implementation. only impact could be if somebody has decided to pass on to a specific page the kwarg `reason` which is extremely minimal risk, and should be anyway easily detected through already present testing Do I have go ahead to propose a PR? -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/71d5d7a0-da83-468b-8abb-96478fdcc0e4n%40googlegroups.com.