使用runserver目前没有办法加SSL 使用HTTPS,要么部署在一个WEB服务器上去配置,目前找到了另一个办法,使用runsslserver
安装:
pip install django-extensions
pip install django-werkzeug-debugger-runserver
pip install pyOpenSSL
证书生成参考:http://blog.csdn.net/happyteafriends/article/details/53668131
启动方式:
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
如果自己没有证书,它也会使用一个内置证书来启动。
参考:
http://www.voidcn.com/blog/huplion/article/p-6244112.html