V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
dracarysX
V2EX  ›  Python

一款基于 Flask 开发 restAPI 的脚手架

  •  
  •   dracarysX · 2016-12-22 10:56:27 +08:00 · 3744 次点击
    这是一个创建于 2684 天前的主题,其中的信息可能已经有所发展或是发生改变。

    简介

    一款简易的 restapi 开发脚手架。服务端采用 flask , orm 使用 peewee ,表单使用 wtform 。都是轻量级框架,简单易学。实现自定义查询、表单保存,模型数据序列化, APIMethodView ( curd 操作)等。主要是实现下面好玩的查询 API ,API 格式参考

    ##查询 API

    > curl http://127.0.0.1:5000/authors
    {"status": {"message": "200 OK", "code": 0}, "data": {"count": 0, "items": [], "limit": 10, "page": 1, "max_page": 0}}
    # 查询年龄大于 25 的作者
    > curl http://127.0.0.1:5000/authors?age=gt.25
    # 查询姓名包含 dracarys 的作者
    > curl http://127.0.0.1:5000/authors?name=like.dracarys
    # 仅仅返回作者 ID
    > curl http://127.0.0.1:5000/authors?select=id
    

    项目地址: https://github.com/dracarysX/flask_restapi 有兴趣的可以一起交流。

    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5834 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 06:13 · PVG 14:13 · LAX 23:13 · JFK 02:13
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.