Sanic教程

Sanic是一个Python异步Web框架,这个栏目从入门到进阶的写Sanic教程。Python 3.6之后用异步进行开发会成为常态化。

  • Sanic app 模块

    Sanic app 模块主要定义了Sanic类,本文介绍Sanic类的API接口。Sanic app 模块该模块主要是类Sanic的定义:class sanic.app.San...
    5年前 (2019-06-04) 阅读(6550) 评论(0)
  • Sanic url_for() 方法/函数

    Sanic 类的url_for()方法的API接口。 url_for() 方法/函数定义url_for(view_name: str, **kwargs)根据视图名称和提供...
    5年前 (2019-06-04) 阅读(4891) 评论(0)
  • Sanic static() 方法/函数

    Sanic 类的static()方法的API接口。static() 方法/函数定义static(uri, file_or_directory, pattern='/?.+', use_modified_sinc...
    5年前 (2019-06-04) 阅读(5192) 评论(0)
  • Sanic run() 方法/函数

    Sanic 类的run()方法的API接口。 run() 方法/函数定义run(host: Optional[str] = None, port: Optional[int] = None, deb...
    5年前 (2019-06-04) 阅读(4455) 评论(0)
  • Sanic route() 方法/函数

    Sanic 类的route()方法的API接口。 route() 方法/函数定义route(uri, methods=frozenset({'GET'}), host=None, strict_sl...
    5年前 (2019-06-04) 阅读(4270) 评论(0)
  • Sanic middleware() 方法/函数

    Sanic 类的middleware()方法的API接口。middleware() 方法/函数定义middleware(middleware_or_request)装饰并注册中间件在请...
    5年前 (2019-06-04) 阅读(4134) 评论(0)
  • Sanic listener() 方法/函数

    Sanic 类的listener()方法的API接口。listener() 方法/函数定义listener(event)从被装饰的函数创建一个监听器。参数event...
    5年前 (2019-06-04) 阅读(4062) 评论(0)
  • Sanic head(), options(), patch(), put() 方法/函数

    Sanic 类的head(), options(), patch(), put()方法的API接口。 head() 方法/函数定义head(uri, host=None, strict_slashe...
    5年前 (2019-06-04) 阅读(4285) 评论(0)
  • Sanic delete()方法/函数

    Sanic 类的delete()方法的API接口。delete()方法/函数定义delete(uri, host=None, strict_slashes=None, version=None, name=No...
    5年前 (2019-06-04) 阅读(3504) 评论(0)
  • Sanic post() 方法/函数

    Sanic 类的post()方法的API接口。 post() 方法/函数定义post(uri, host=None, strict_slashes=None, stream=False, versi...
    5年前 (2019-06-04) 阅读(5178) 评论(0)
  • Sanic get() 方法/函数

    Sanic 类的get()方法的API接口。get() 方法/函数定义get(uri, host=None, strict_slashes=None, version=None, name=None)添...
    5年前 (2019-06-04) 阅读(4866) 评论(0)
  • Sanic exception() 方法/函数

    Sanic 类的exception()方法的API接口。exception() 方法/函数定义exception(*exceptions)装饰要注册为异常处理程序的函数....
    5年前 (2019-06-04) 阅读(3383) 评论(0)
  • Sanic create_server() 方法/函数

    Sanic 类的create_server()方法的API接口。 create_server() 方法/函数定义coroutine create_server(host: Optional[str]...
    5年前 (2019-06-04) 阅读(4308) 评论(0)
  • Sanic blueprint() 方法/函数

    Sanic 类的blueprint()方法的API接口。blueprint() 方法/函数定义blueprint(blueprint, **options)注册蓝图到应用。参数b...
    5年前 (2019-06-04) 阅读(3887) 评论(0)
  • Sanic websocket() 方法/函数

    Sanic 类的websocket()方法的API接口。websocket() 方法/函数定义websocket(uri, host=None, strict_slashes=None, subprotocol...
    5年前 (2019-06-04) 阅读(3775) 评论(0)
  • Sanic add_websocket_route() 方法/函数

    Sanic 类的add_websocket_route()方法的API接口。add_websocket_route() 方法/函数定义add_websocket_route(handler, uri, host...
    5年前 (2019-06-04) 阅读(3096) 评论(0)
  • Sanic add_task()方法/函数

    Sanic 类的add_task()方法的API接口。add_task()方法/函数定义add_task(task)在循环开始后安排任务稍后运行。 与asyncio.ens...
    5年前 (2019-06-04) 阅读(5070) 评论(0)
  • Sanic add_route() 方法/函数

    Sanic 类的add_route()方法的API接口。add_route() 方法/函数定义:add_route(handler, uri, methods=frozenset({'GET'}), host...
    5年前 (2019-06-04) 阅读(3762) 评论(0)
  • Sanic 扩展

    Sanic作为一款应用比较广泛的异步web框架,已经形成了比较成熟的技术链,其周边的各种扩展应有尽有。扩展和插件开发Sanic-Plugi...
    5年前 (2019-04-21) 阅读(12298) 评论(0)
  • Sanic 部署

    部署Sanic的方法有很多种,可以通过内置的 webserver,也可以通过Gunicorn等。内置webserver定义sanic.Sanic实例后,我们可以使...
    5年前 (2019-04-21) 阅读(14227) 评论(0)