相关配置-功能模块

fansichao 2021-10-23 16:25:17
Categories: Tags:

功能模块

Django配置API为HTTPS

安装组件

1
2
3
pip install django-extensions
pip install django-werkzeug-debugger-runserver
pip install pyOpenSSL

在INSTALLED_APPS 中注册

1
2
'werkzeug_debugger_runserver',
'django_extensions',

启动命令

1
2
3
4
5
6
# 指定 cert 
python manage.py runserver_plus --cert server.crt 0.0.0.0:10000

# gunicorn 指定证书
gunicorn myblog.wsgi:application -c gunicorn.fsc.conf.py --daemon --reload \
--certfile=server.crt --keyfile=server.key

即可正常访问 https 服务

1
https://xxxxxx

页面日志流配置

问题: Gunicorn 模式下无法访问 websocket