I added these codes to settings.py for extra security
SECURE_BROWSER_XSS_FILTER = True
SECURE_CONTENT_TYPE_NOSNIFF = True
SECURE_SSL_REDIRECT = True
SECURE_HSTS_SECONDS = 86400
SECURE_HSTS_PRELOAD = True
SECURE_HSTS_INCLUDE_SUBDOMAINS = True
SESSION_COOKIE_SECURE = True
CSRF_COOKIE_SECURE = True
Then on 127.0.0.1:8000 I could no longer connect to the Django server, even when I deleted that line of code I couldn't connect to the Django development server even in another project. Browsers return this
This site can't provide a secure connection. 127.0.0.1 sent an invalid response. ERR_SSL_PROTOCOL_ERROR Django Console: [31/Mar/2024 22:15:09] code 400, message Bad request version ('8³£\x14õì=®\x18\x01\x8f*Ú\x86á\x00') Django version: 4.1.7
I tried clearing the cache / using other browsers and reversing the same code snippet but to no avail .Someone even recommended resetting the database, but it didn't help