I have a requirement to convert http to https if the redirect (HttpResponseRedirectBase) happens in django. So I'd like to write a middleware to handle that. I have put the middleware in the top of the middleware list, hope that's correct.I have used the following sample code. But when redirect happens, the url is not the full url, but relative url. So I don't know how to overwrite the url or schema(http or https). I have thought I could replace the http to https in the response, but the content of the response is also empty. So what should I do?
def process_response(self, request,response):