异步rest api资源数据库
guillotina的Python项目详细描述
简介
请阅读详细文档
这是基于异步的下一代断头台服务器的工作项目。
依赖关系
- python=3.7
- PostgreSQL=9.6
快速启动
我们使用pip:
pip install guillotina
运行PostgreSQL
如果你没有postgresql服务器,你可以很容易地运行一个 与Docker一起。
下载并运行以下命令启动Docker容器:
make run-postgres
运行服务器
要运行服务器:
g
然后…
< Buff行情> curl http://localhost:8080或者,更好的方法是,使用postman开始使用api。
您还可以通过访问http://localhost:8080/+admin/" rel="nofollow">http://localhost:8080/+admin/,使用内置的web管理界面在断头台服务器中导航。
开发入门
使用pip(需要python>;3.7):
git clone git@github.com:plone/guillotina.git cd guillotina python3.7 -m venv . ./bin/pip install -r requirements.txt ./bin/pip install -r contrib-requirements.txt ./bin/pip install -e .[test] ./bin/pre-commit install
运行测试
我们正在使用pytest:
./bin/pytest guillotina
对于测试覆盖率:
./bin/pytest --cov=guillotina guillotina/
使用文件监视程序…
< Buff行情> ./bin/ptw断头台–运行器=./bin/py.测试使用蟑螂数据库运行测试:
USE_COCKROACH=true ./bin/pytest guillotina
默认值
可以使用authorization header:basic root:root进行默认根访问
码头工人
你也可以和Docker一起做断头台!
首先,运行postgresql:
docker run --rm \ -e POSTGRES_DB=guillotina \ -e POSTGRES_USER=guillotina \ -p 127.0.0.1:5432:5432 \ --name postgres \ postgres:9.6
然后,运行断头台:
docker run --rm -it \ --link=postgres -p 127.0.0.1:8080:8080 \ guillotina/guillotina:latest \ g -c '{"databases": [{"db": {"storage": "postgresql", "dsn": "postgres://guillotina:@postgres/guillotina"}}], "root_user": {"password": "root"}}'
这假设您在当前工作目录中有一个config.yaml
聊天
加入我们,在https://gitter.im/plone/guillotina" rel="nofollow">https://gitter.im/plone/guillotina