GithubHelp home page GithubHelp logo

myflaskrestful's Introduction

项目构成usr
    基于blueprint的redprint
        1)为什么这么搞?
            因为使用原生的blueprint只能实现注册一层,如果想要实现两层注册的话,用blueprint是无法实现的
        2)怎么搞的?
            使用blueprint提供的add_url_rule接口将第二层视图函数直接注册到flask对象上,
            注册过程中加入我们需要的功能,比如url_prefiex,

表单验证
    wtform
        1)如何使它支持json格式?
            只需要显式的传入data字典即可
        2)如何在验证的时候发现不合法字段,自动返回,减少代码量?
            重写Form模块,手动在验证失败之后返回自定义的Exception,所有的validatorForm继承重写后的Form

异常处理
    编写继承werkzeug.exceptions.HTTPException的APIRequestException,构造response

myflaskrestful's People

Contributors

wushaojun321 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.