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
原文链接:https://blog.csdn.net/qq_38059635/article/details/88075449