@fuyb1986
2017-05-11T10:05:10.000000Z
字数 677
阅读 731
金色童年
框架
使用 Django reset framework
- 配置文件
golden_childhood/settings.py- 安装
pip install djangorestframework
pip install markdown
pip install django-filter # Filtering support
pip install djangorestframework-filters- 文档
http://www.django-rest-framework.org/
运行
使用 python gunicorn.
- 配置文件
guicorn.conf- 安装
pip install guicorn- 文档
http://docs.gunicorn.org/en/stable/
启动与停止 web 服务
- 管理
使用 systemd 管理服务- 启动服务
sudo server.sh restart- 重启服务
sudo server.sh restart- 停止服务
sudo server.sh stop
启动与停止 task 服务
- task 用于发送短信、消息、缓存数据等等
- 这些数据都存放在 redis 里,使用 redis 的消息从其它主机接收数据
- 只有一台主机运行这个服务
- 管理
使用 systemd 管理服务- 启动服务
sudo task.sh start- 重启服务
sudo task.sh restart- 停止服务
sudo task.sh stop
上线方法
- 上线 html5
/opt/uptime/uptime_html_remote.sh- 上线 web server
/opt/uptime/uptime_remote.sh