我在跑步:
python manage.py runserver localhost:44100
这将我重定向到 https
:
» http http://localhost:44100/
HTTP/1.0 301 Moved Permanently
Content-Type: text/html; charset=utf-8
Date: Mon, 05 Mar 2018 14:09:09 GMT
Location: https://localhost:44100/
Server: WSGIServer/0.1 Python/2.7.14
X-Frame-Options: SAMEORIGIN
为什么/这是怎么发生的?什么设置控制 Django
接受 http
/ https
?
原文由 blueFast 发布,翻译遵循 CC BY-SA 4.0 许可协议
runserver
命令只处理http。但是,如果您将
SECURE_SSL_REDIRECT
设置为True
那么您将从 http 重定向到 https。有关更多信息,请参阅有关 SSL/HTTPS 的 Django 文档。