Django开启https(不用nginx)


首先安装需要用到的包

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

添加到INSTALLED_APPS

INSTALLED_APPS = [
    ...
    'werkzeug_debugger_runserver',  # 开启https需要的服务
    'django_extensions',  # 开启https需要的服务
    ...   
]

启动https服务

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

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM