django使用https

使用 runserver 是不能使用 https 的

解决办法:使用 runsslserver

步骤:

  1.安装:

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

  2.启动方式

python manage.py runsslserver 0.0.0.0:8100 \
--certificate /etc/pki/libvirt-spice/server-cert.pem \
--key /etc/pki/libvirt-spice/server-key.pem

  3.修改setting.py中的INSTALLED_APPS

INSTALLED_APPS = (...
"sslserver",
...
)

 

终。

 

posted @ 2018-01-22 16:37  KennySs  阅读(3806)  评论(0编辑  收藏  举报