RequestContext is only used to pass values ββto the template engine when rendering the template. The type of destination should not depend on the RequestContext from the original type, it should be able to generate its own RequestContext.
However, there are situations where you need to pass values ββbetween representations like this. In these situations, you can use the querystring values ββfor this. For instance...
def originating_view(request, *args, **kwargs): return HttpResponseRedirect('/accounts/login/?username=%s&next=%s' % (username, request.path) def destination_view(request, *args, **kwargs):
(Please note that I assume that you want to save the username so that it is pre-populated in the login form. If you are actually logging in, you will want to use POST instead so that the username and password are not written in text form URL).
source share