2019-03-26——Chrome无法通过https方式打开d

2019-03-26  本文已影响0人  bonnie_xing

背景:

当进行django第一章练习时,工程启动后,无法通过Chrome打开django的连接。

提示错误:You're accessing the development server over HTTPS, but it only supports HTTP。

第一张练习连接:https://docs.djangoproject.com/en/2.1/intro/tutorial01/

启动命令:python manage.py runserver 0.0.0.0:8000

解决方法:

安装包

pip install django-extensions

pip install django-werkzeug-debugger-runserver

pip install pyOpenSSL

修改setting.py

vi mysite/settings.py

在INSTALLED_APPS中增加

'werkzeug_debugger_runserver',

 'django_extensions',

启动工程

python manage.py runserver_plus --cert server.crt 172.24.31.181:8082

在Chrome中输入ip+port打开

https://172.24.31.181:8082/

上一篇 下一篇

猜你喜欢

热点阅读