3

I am using python 3.5 & django 1.10 on windows 7 os.

I re-started my laptop today and when I attempt to access my python-django app on my local development server, I now receive the following error:

Starting development server at http://127.0.0.1:8000/
Quit the server with CTRL-BREAK.
[11/Oct/2016 17:16:17] code 400, message Bad request version ('À\x13À')
[11/Oct/2016 17:16:17] You're accessing the development server over HTTPS, but i
t only supports HTTP.

[11/Oct/2016 17:16:17] code 400, message Bad request syntax ('\x16\x03\x01\x00§\
x01\x00\x00£\x03\x03]=Ä)\xa0L\x13\x11\x01;æ\x16:ÅUù\tÓÚß\x0c½\x01z¯êÉú¦ñÚ\x93\x0
0\x00"̨̩Ì\x14Ì\x13À+À/À,À0À\tÀ\x13À')
[11/Oct/2016 17:16:17] You're accessing the development server over HTTPS, but i
t only supports HTTP.

I haven't made any recent changes to the settings.py file, so I am assuming that the settings are not the culprit here, but here are some relevant settings it case it helps solve the issue:

SECURE_SSL_REDIRECT = False
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
ALLOWED_HOSTS = ['127.0.0.1', 'localhost']

I have searched SO and found this post on the subject. The answer suggests that I Switch back to http and that error will disappear.

Does this mean that I should change or enter the url in the browser from https://127.0.0.1:8000/ to http://127.0.0.1:8000/? I am asking this because when I try to do that, the url in the browser automatically reverts to https://127.0.0.1:8000/. I cannot seem to over-ride the https with http.

I have seen this post. I have cleared my browser cache, but the issue continues.

I have run out of ideas.

I would be grateful for any suggestions.

Community
  • 1
  • 1
user1261774
  • 3,525
  • 10
  • 55
  • 103
  • Jérôme, I saw this post and included it in the op, with the text that it does not help me. Any suggestions? – user1261774 Oct 11 '16 at 07:37
  • Sorry, read too fast. My bad. – Jérôme Oct 11 '16 at 07:42
  • Do you run any other projects on localhost that do use HTTPS? If another project sets the HSTS (HTTP Strict Transport Security) headers, you might have to remove localhost from your browser's HSTS cache. How you do that depends on which browser you're using. – knbk Oct 11 '16 at 09:45
  • knbk, I am using the one project, but in the last 2 weeks upgraded my test project from python 2.7 to 3.5. I have the different versions in their own virtual environments. All seemed to be working fine until I restarted my laptop. This issue occurs with chrome and firefox browsers. Do you have instructions on how I remove localhost from the browser's HSTS cache? – user1261774 Oct 11 '16 at 20:52
  • Try this now. Updated the asnwer. – Prakhar Trivedi Jan 06 '17 at 05:33
  • @PrakharTrivedi which answer did you meant ? I have the same issue, can't find answers – illevens Aug 03 '20 at 20:47

0 Answers0