Sanic教程
Sanic是一个Python异步Web框架,这个栏目从入门到进阶的写Sanic教程。Python 3.6之后用异步进行开发会成为常态化。
-
Sanic app 模块
Sanic app 模块主要定义了Sanic类,本文介绍Sanic类的API接口。Sanic app 模块该模块主要是类Sanic的定义:class sanic.app.San...6年前 (2019-06-04) 阅读(7211) 评论(0) -
Sanic url_for() 方法/函数
Sanic 类的url_for()方法的API接口。 url_for() 方法/函数定义url_for(view_name: str, **kwargs)根据视图名称和提供...6年前 (2019-06-04) 阅读(5367) 评论(0) -
Sanic static() 方法/函数
Sanic 类的static()方法的API接口。static() 方法/函数定义static(uri, file_or_directory, pattern='/?.+', use_modified_sinc...6年前 (2019-06-04) 阅读(5723) 评论(0) -
Sanic run() 方法/函数
Sanic 类的run()方法的API接口。 run() 方法/函数定义run(host: Optional[str] = None, port: Optional[int] = None, deb...6年前 (2019-06-04) 阅读(4961) 评论(0) -
Sanic route() 方法/函数
Sanic 类的route()方法的API接口。 route() 方法/函数定义route(uri, methods=frozenset({'GET'}), host=None, strict_sl...6年前 (2019-06-04) 阅读(4744) 评论(0) -
Sanic middleware() 方法/函数
Sanic 类的middleware()方法的API接口。middleware() 方法/函数定义middleware(middleware_or_request)装饰并注册中间件在请...6年前 (2019-06-04) 阅读(4588) 评论(0) -
Sanic listener() 方法/函数
Sanic 类的listener()方法的API接口。listener() 方法/函数定义listener(event)从被装饰的函数创建一个监听器。参数event...6年前 (2019-06-04) 阅读(4616) 评论(0) -
Sanic head(), options(), patch(), put() 方法/函数
Sanic 类的head(), options(), patch(), put()方法的API接口。 head() 方法/函数定义head(uri, host=None, strict_slashe...6年前 (2019-06-04) 阅读(4881) 评论(0) -
Sanic delete()方法/函数
Sanic 类的delete()方法的API接口。delete()方法/函数定义delete(uri, host=None, strict_slashes=None, version=None, name=No...6年前 (2019-06-04) 阅读(3928) 评论(0) -
Sanic post() 方法/函数
Sanic 类的post()方法的API接口。 post() 方法/函数定义post(uri, host=None, strict_slashes=None, stream=False, versi...6年前 (2019-06-04) 阅读(5659) 评论(0) -
Sanic get() 方法/函数
Sanic 类的get()方法的API接口。get() 方法/函数定义get(uri, host=None, strict_slashes=None, version=None, name=None)添...6年前 (2019-06-04) 阅读(5379) 评论(0) -
Sanic exception() 方法/函数
Sanic 类的exception()方法的API接口。exception() 方法/函数定义exception(*exceptions)装饰要注册为异常处理程序的函数....6年前 (2019-06-04) 阅读(3830) 评论(0) -
Sanic create_server() 方法/函数
Sanic 类的create_server()方法的API接口。 create_server() 方法/函数定义coroutine create_server(host: Optional[str]...6年前 (2019-06-04) 阅读(4751) 评论(0) -
Sanic blueprint() 方法/函数
Sanic 类的blueprint()方法的API接口。blueprint() 方法/函数定义blueprint(blueprint, **options)注册蓝图到应用。参数b...6年前 (2019-06-04) 阅读(4364) 评论(0) -
Sanic websocket() 方法/函数
Sanic 类的websocket()方法的API接口。websocket() 方法/函数定义websocket(uri, host=None, strict_slashes=None, subprotocol...6年前 (2019-06-04) 阅读(4261) 评论(0) -
Sanic add_websocket_route() 方法/函数
Sanic 类的add_websocket_route()方法的API接口。add_websocket_route() 方法/函数定义add_websocket_route(handler, uri, host...6年前 (2019-06-04) 阅读(3583) 评论(0) -
Sanic add_task()方法/函数
Sanic 类的add_task()方法的API接口。add_task()方法/函数定义add_task(task)在循环开始后安排任务稍后运行。 与asyncio.ens...6年前 (2019-06-04) 阅读(5570) 评论(0) -
Sanic add_route() 方法/函数
Sanic 类的add_route()方法的API接口。add_route() 方法/函数定义:add_route(handler, uri, methods=frozenset({'GET'}), host...6年前 (2019-06-04) 阅读(4227) 评论(0) -
Sanic 扩展
Sanic作为一款应用比较广泛的异步web框架,已经形成了比较成熟的技术链,其周边的各种扩展应有尽有。扩展和插件开发Sanic-Plugi...6年前 (2019-04-21) 阅读(12959) 评论(0) -
Sanic 部署
部署Sanic的方法有很多种,可以通过内置的 webserver,也可以通过Gunicorn等。内置webserver定义sanic.Sanic实例后,我们可以使...6年前 (2019-04-21) 阅读(15042) 评论(0)