消息服务器后端
msg的Python项目详细描述
#消息
[![特拉维斯CI状态](https://travis-ci.org/lily-seabreeze/msg.svg)](https://travis-ci.org/lily-seabreeze/msg) [![工作服代码覆盖范围](https://img.shields.io/coveralls/lily-seabreeze/msg.svg)](https://coveralls.io/github/lily-seabreeze/msg) [![pypi](https://img.shields.io/pypi/v/msg.svg)](https://pypi.python.org/pypi/msg)
msg是一个简单而强大的restful[面向服务的体系结构(soa)](https://en.wikipedia.org/wiki/Service-oriented_architecture) 消息库。
msg专注于任何消息传递系统的重叠核心功能, 所以你可以跳到实现酷的部分。你可以用味精 创建实时聊天/即时消息、论坛、Twitter克隆、博客等。
msg在python 2和3中运行。msg可以配置为使用 sqlalchemy支持的任何数据库。
这个项目的优点是它的焦点/范围很小 我们为您提供最完美的信息系统。
对于rest api、安装说明、部署说明等, 请阅读[官方消息维基](https://github.com/lily-seabreeze/msg/wiki)!
##一般设置
- install and launch redis server
- Edit msg/config.py or override
- pip install -r requirements/base.txt
- gunicorn msg.msg:app –worker-class gevent –bind localhost:5000
如果您使用的是非默认数据库:
python-c“import msg.msg;msg.msg.init_db()”
##测试一下
要使演示正常工作,您需要安装 允许控件允许源代码:*Firefox插件, 铬合金,随便。
- cd examples
- python msgviewer.py
- Checkout http://localhost:8080/ and http://localhost:8080/stream
如果您使用的是httpie(sudo apt install httpie)下面是一些示例命令:
- Create a user: http POST localhost:5000/user username=kitten password=yarn
- Create a message: http POST localhost:5000/message text=”i love kittens” –auth kitten:yarn