1.django 默认的runserver使用的是http协议,如果需要https协议,需要以下3个库

pip install django-extensions
pip install django-werkzeug-debugger-runserver
pip install pyOpenSSL

2.配置settings文件 在INSTALLED_APPS下添加

‘werkzeug_debugger_runserver’,
‘django_extensions’,

3. 在终端使用命令运行

python manage.py runserver_plus --cert server.crt 0.0.0.0:8000

若无法访问,可用本地ip,

例如:python manage.py runserver_plus --cert server.crt 10.10.8.280:8000

django http转换为https(转载) 

 

原文链接:https://blog.csdn.net/qq_38059635/article/details/88075449 

相关文章:

  • 2022-12-23
  • 2021-11-04
  • 2021-12-03
  • 2022-12-23
  • 2021-12-13
  • 2021-09-23
  • 2021-12-13
猜你喜欢
  • 2021-11-17
  • 2021-12-03
  • 2021-05-24
  • 2021-10-21
  • 2022-12-23
  • 2021-07-06
  • 2021-11-17
相关资源
相似解决方案