代码之家  ›  专栏  ›  技术社区  ›  Soerendip

使用chrome无法访问没有ssl的django development server

  •  0
  • Soerendip  · 技术社区  · 6 年前

    我建立了一个干净的django项目:

    django-admin startproject newProject
    cd newProject
    python manage.py migrate
    python manage.py runserver
    
    January 29, 2019 - 00:30:02 Django version 2.1.2, using settings
    'unchained.settings' Starting development server at
    http://127.0.0.1:8000/
    

    http://127.0.0.1:8000/ 使用Google Chrome(71.0.3578.98):

    [29/Jan/2019 00:30:08] You're accessing the development server over HTTPS, but it only supports HTTP.
    
    [29/Jan/2019 00:30:08] code 400, message Bad request version ('ÊÊÀ+À/À,À0̨̩À\x13À\x14\x00\x9c\x00\x9d\x00/\x005\x00')
    [29/Jan/2019 00:30:08] You're accessing the development server over HTTPS, but it only supports HTTP.
    

    所以,在过去的某个时候,我用一个完全无关的项目激活了SSL。出于某种奇怪的原因,chrome现在期望HTTPS。我可能可以通过删除浏览器缓存来修复它,但我并不想丢失其中的所有数据。

    你怎么解决这个问题?

    1 回复  |  直到 6 年前
        1
  •  1
  •   Shubhitgarg    6 年前

    Django开发服务器仅使用 Http 协议而不是 Https . 您的网站正在打开 https://127.0.0.1:8000/ http://127.0.0.1:8000/

    settings .py 和改变

    SECURE_SSL_REDIRECT = False