In Django Debug request url shown as http instead of https

sorry if the message reads weird: it was originally intended for django support.

Let me give a little bit of context to the issue. Recently, my team has upgraded the packages of our app, one of those packages being Django, from 2.2 to 3.2.13. The only thing in this commit are the changes of packages.

There is an endpoint on our app that has been tested on a local host and deployed to a dev server and a QA/Test server, and has worked as intended.

However, this endpoint fails on our prod deployment, with the ssl issue that you are seeing before you. I was wondering if this has anything to do with the request URL being shown as an http rather than an https. As you can see, the page that we are on shows it’s an https, differing from the Django debug which is showing as an http.

Question 1: Am I correct to assume the request being made is an http even though the URL shows as an https?

My hypothesis is that this issue is only manifesting itself in production because our prod environment wont allow traffic over http.

If this is the case, I am wondering what would have changed between Django 2.2 and 3.2 that is causing this issue.

Question 2: What could have changed in between Django 2.2 and Django3.2 that would cause this issue.

And my final question is if the proposed fix will work. Right now we don’t have SSL_SECURE_REDIRECT defined in and in the Django Debug environment variables, the value is listed as false.

Question 3: Could defining SSL_SECURE_REDIRECT to TRUE fix our issue?

enter image description here

Back to Top