Giter VIP home page Giter VIP logo

sanic-doc-zh_cn's Introduction

Sanic

Join the chat at https://gitter.im/sanic-python/Lobby Build Status PyPI PyPI version

Sanic是一个适用于Python3.5+,类似于Flask般简洁的web服务器,有着更快的速度。她基于magicstack那帮神奇的伙计们完成的工作,受启发于 这篇文章

在类似于Flask那般简洁的基础之上, Sanic支持async异步请求处理。 这意味着你可以使用从Python3.5开始的新async/await语法来构建更快的非阻塞代码。

Sanic在 GitHub 上开发,欢迎参与贡献!

如果你的一个项目中用到了Sanic请确保提交 issue,以便我们追踪这些项目!

Hello World 示例

from sanic import Sanic
from sanic.response import json

app = Sanic()

@app.route("/")
async def test(request):
    return json({"hello": "world"})

if __name__ == "__main__":
    app.run(host="0.0.0.0", port=8000)

安装

  • pip install sanic

使用bash命令可以安装不包括uvloop与json的Sanic, 你可以设置任一或全部的SANIC_NO_X 变量为确定性字符串,例如 'y', 'yes', 't', 'true', 'on', '1',那样就不会安装相应属性的包。

  • SANIC_NO_UVLOOP=true SANIC_NO_UJSON=true pip install sanic

当前工作分支

翻译latest稳定版

文档

在gitbook网站上阅读中文文档 在readthedocs网站上阅读中文文档 在readthedocs网站上阅读英文文档

示例

非典型性扩展例子. 超出Sanic范畴的示例与扩展.

扩展. 社区创建的Sanic扩展。

项目. Sanic在实际项目中的应用.

TODO

  • http2

不足

  • Windows平台没有uvloop和httptools这样的工具 :(

终极**

                 ▄▄▄▄▄
        ▀▀▀██████▄▄▄       _______________
      ▄▄▄▄▄  █████████▄  /                 \
     ▀▀▀▀█████▌ ▀▐▄ ▀▐█ |   Gotta go fast!  |
   ▀▀█████▄▄ ▀██████▄██ | _________________/
   ▀▄▄▄▄▄  ▀▀█▄▀█════█▀ |/
        ▀▀▀▄  ▀▀███ ▀       ▄▄
     ▄███▀▀██▄████████▄ ▄▀▀▀▀▀▀█▌
   ██▀▄▄▄██▀▄███▀ ▀▀████      ▄██
▄▀▀▀▄██▄▀▀▌████▒▒▒▒▒▒███     ▌▄▄▀
▌    ▐▀████▐███▒▒▒▒▒▐██▌
▀▄▄▄▄▀   ▀▀████▒▒▒▒▄██▀
          ▀▀█████████▀
        ▄▄██▀██████▀█
      ▄██▀     ▀▀▀  █
     ▄█             ▐▌
 ▄▄▄▄█▌              ▀█▄▄▄▄▀▀▄
▌     ▐                ▀▀▄▄▄▀
 ▀▀▄▄▀

sanic-doc-zh_cn's People

Contributors

wangyves avatar

Watchers

 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.