FastWeb是一个由Tornado、Celery、Thrift引用的Python快速构建Web框架
cli-fastweb的Python项目详细描述
快网-快网-快网-快网-快网-快网-快网-快网-快网-快网-快网-快网-快网-快网-快网-快网-快网-快网-快网例
----
…代码块::ini(component.ini)
mysql组
[mysql:test_mysql]
host=localhost
port=3306
user=user name
password=password
db=db戋name
timeout=5
charset=utf8
size=5
away=300
;mongo
[mongo:test戋mongo]
host=localhost
port=27017
超时=10
;redis
[redis:test廑redis]
主机=localhost
端口=6379
db=1
;task组
[任务:测试任务]
名称=测试任务
代理=amqp://guest:guest@localhost:5672/
后端=redis://localhost/0
任务=一些任务。add.add
队列=测试任务队列
交换=测试任务交换
路由密钥=测试任务路由密钥
代码块::python
“handler(handler.test)”“
来自fastweb导入请求
来自fastweb.web导入api,page
来自fastweb.web导入协同路由,在执行器上运行_
类测试(api):
@coroutine
@checkargument(name=str,sex=int)
def get(self):
#吰handler级31243池
自加载执行器(5)
handler级31243池
r=yield self.test池executor()
mysql使
ret=yield self.test池mysql.query('select*from table limit 20;')
print self.test_mysql.fetch()
ret=yielself.http请求(请求)
/>#处理程序
@run-onu执行器
def test执行器(self):
time.sleep(10)return
“从fastweb start.web服务器
是的syncpattern,asynpattern
path=options.config)
app.load_组件(pattern=asynpattern,backend='ini',path='task.ini')
代码块::ini
;任务设置(task.ini)
;task组
[任务:测试任务]
名称=测试任务
代理=amqp://guest:guest@localhost:5672/
后端=redis://localhost/0
任务=一些任务。add.add
队列=测试任务队列
交换=测试任务交换
路由密钥=测试任务路由密钥
代码块::python
class add(对象):
“
def run(self,x,y):
return x+y
if __name__ == '__main__':
app.load_recorder('task.log', system_level='DEBUG')
app.load_component(pattern=AsynPattern, backend='ini', path='task.ini')
start_task_worker()
Service层示例
------------
请参考examples中示例。
安装
----
``python setup install``
``pip install fastweb``
适用场景
-------
Fastweb是一个快速构建web应用的框架,与Python的哲学相同,都是期望能够让使用者更快速的开发出满足需求的后端代码。
高速迭代,快速试错,这是使用Fastweb最大的效益!
抉择
----
关于为什么选择 ``Tornado`` ``Celery`` ``Thrift`` 作为Fastweb的工具集合中的重要成员。
.. |build-status| image:: https://travis-ci.org/BSlience/fastweb.svg?branch=master
:alt: Build status
:target: https://travis-ci.org/BSlience/fastweb
----
…代码块::ini(component.ini)
mysql组
[mysql:test_mysql]
host=localhost
port=3306
user=user name
password=password
db=db戋name
timeout=5
charset=utf8
size=5
away=300
;mongo
[mongo:test戋mongo]
host=localhost
port=27017
超时=10
;redis
[redis:test廑redis]
主机=localhost
端口=6379
db=1
;task组
[任务:测试任务]
名称=测试任务
代理=amqp://guest:guest@localhost:5672/
后端=redis://localhost/0
任务=一些任务。add.add
队列=测试任务队列
交换=测试任务交换
路由密钥=测试任务路由密钥
代码块::python
“handler(handler.test)”“
来自fastweb导入请求
来自fastweb.web导入api,page
来自fastweb.web导入协同路由,在执行器上运行_
类测试(api):
@coroutine
@checkargument(name=str,sex=int)
def get(self):
#吰handler级31243池
自加载执行器(5)
handler级31243池
r=yield self.test池executor()
mysql使
ret=yield self.test池mysql.query('select*from table limit 20;')
print self.test_mysql.fetch()
ret=yielself.http请求(请求)
/>#处理程序
@run-onu执行器
def test执行器(self):
time.sleep(10)return
“从fastweb start.web服务器
是的syncpattern,asynpattern
path=options.config)
app.load_组件(pattern=asynpattern,backend='ini',path='task.ini')
代码块::ini
;任务设置(task.ini)
;task组
[任务:测试任务]
名称=测试任务
代理=amqp://guest:guest@localhost:5672/
后端=redis://localhost/0
任务=一些任务。add.add
队列=测试任务队列
交换=测试任务交换
路由密钥=测试任务路由密钥
代码块::python
class add(对象):
“
def run(self,x,y):
return x+y
if __name__ == '__main__':
app.load_recorder('task.log', system_level='DEBUG')
app.load_component(pattern=AsynPattern, backend='ini', path='task.ini')
start_task_worker()
Service层示例
------------
请参考examples中示例。
安装
----
``python setup install``
``pip install fastweb``
适用场景
-------
Fastweb是一个快速构建web应用的框架,与Python的哲学相同,都是期望能够让使用者更快速的开发出满足需求的后端代码。
高速迭代,快速试错,这是使用Fastweb最大的效益!
抉择
----
关于为什么选择 ``Tornado`` ``Celery`` ``Thrift`` 作为Fastweb的工具集合中的重要成员。
.. |build-status| image:: https://travis-ci.org/BSlience/fastweb.svg?branch=master
:alt: Build status
:target: https://travis-ci.org/BSlience/fastweb