django site ERR_SSL_PROTOCOL_ERROR après le paramétrage de https

Donc, j’essaie de déployer mon site et essentiellement essayé

python manage.py check --deploy 

et a suivi ce qu’il m’a dit:

 WARNINGS: ?: (security.W004) You have not set a value for the SECURE_HSTS_SECONDS setting. If your entire site is served only over SSL, you may want to consider setting a value and enabling HTTP Ssortingct Transport Security. Be sure to read the documentation first; enabling HSTS carelessly can cause serious, irreversible problems. ?: (security.W006) Your SECURE_CONTENT_TYPE_NOSNIFF setting is not set to True, so your pages will not be served with an 'x-content-type-options: nosniff' header. You should consider enabling this header to prevent the browser from identifying content types incorrectly. ?: (security.W007) Your SECURE_BROWSER_XSS_FILTER setting is not set to True, so your pages will not be served with an 'x-xss-protection: 1; mode=block' header. You should consider enabling this header to activate the browser's XSS filtering and help prevent XSS attacks. ?: (security.W008) Your SECURE_SSL_REDIRECT setting is not set to True. Unless your site should be available over both SSL and non-SSL connections, you may want to either set this setting True or configure a load balancer or reverse-proxy server to redirect all connections to HTTPS. ?: (security.W012) SESSION_COOKIE_SECURE is not set to True. Using a secure-only session cookie makes it more difficult for network traffic sniffers to hijack user sessions. ?: (security.W016) You have 'django.middleware.csrf.CsrfViewMiddleware' in your MIDDLEWARE, but you have not set CSRF_COOKIE_SECURE to True. Using a secure-only CSRF cookie makes it more difficult for network traffic sniffers to steal the CSRF token. ?: (security.W017) You have 'django.middleware.csrf.CsrfViewMiddleware' in your MIDDLEWARE, but you have not set CSRF_COOKIE_HTTPONLY to True. Using an HttpOnly CSRF cookie makes it more difficult for cross-site scripting attacks to steal the CSRF token. ?: (security.W018) You should not have DEBUG set to True in deployment. ?: (security.W019) You have 'django.middleware.clickjacking.XFrameOptionsMiddleware' in your MIDDLEWARE, but X_FRAME_OPTIONS is not set to 'DENY'. The default is 'SAMEORIGIN', but unless there is a good reason for your site to serve other parts of itself in a frame, you should change it to 'DENY'. ?: (security.W020) ALLOWED_HOSTS must not be empty in deployment. 

Définir fondamentalement tous ceux sur True dans settings.py et définir le mode Debug sur False, et mettre SECURE_HSTS_SECONDS = 300

Cependant, j’ai oublié de configurer mon site sur un serveur avant de le faire et maintenant, quand j’ai essayé d’y accéder, cela me donne cette erreur dans le navigateur:

 Secure Connection Failed An error occurred during a connection to 127.0.0.1:8001. SSL received a record that exceeded the maximum permissible length. Error code: SSL_ERROR_RX_RECORD_TOO_LONG The page you are trying to view cannot be shown because the authenticity of the received data could not be verified. Please contact the website owners to inform them of this problem. 

et ceux en cmd:

 [14/Sep/2016 17:40:46] code 400, message Bad request syntax ('\x16\x03\x01\x00|\x01\x00\x00x\x03\x02\xd3\xb8S<\t¿°\xfd½U»ïä\x98\x99h\xb9¥±T~\x129\x05á\xc0V\t\x9a\xe3\x82E\x00\x00\x10\xc0\t\xc0\x13\xc0') [14/Sep/2016 17:40:46] You're accessing the development server over HTTPS, but it only supports HTTP. 

Bon alors ça me dit clairement le problème: je ne supporte pas les HTTP, mais le paramètre est configuré pour le supporter. Mais ce qui est étrange, c’est que même après avoir supprimé tous ces parameters, le site rest ainsi et que je ne peux même pas y accéder en cours de développement avec DEBUG = True.

J’ai même essayé d’utiliser git pour revenir à la version précédente, et cela n’aide pas. La même erreur persiste. Maintenant, je suis vraiment inquiet que peut-être je viens de le détruire? S’il vous plaît quelqu’un m’aider

Avez-vous essayé un autre navigateur pour accéder à votre site Web (dev)? Peut-être que c’est à cause de la valeur que vous avez donnée sur le paramètre SECURE_HSTS_SECONDS . Si cela est trop élevé (par exemple 31536000 == 1 an), le navigateur continuera de bash la version https de votre site.

Cependant, vous pouvez effacer le paramètre HSTS du navigateur. Peut – être que cela peut aider.

Pour une meilleure compréhension du HSTS (si tel est le problème), lisez cet article.

Faites-moi savoir si cela vous a aidé.