一个小型的wsgi web框架
bustard的Python项目详细描述
一个小小的wsgi web框架。
功能
- 路由器
- orm
- 请求和响应
- cookies和会话
- 模板引擎
- wsgi服务器
安装
pip install bustard pip install psycopg2 # if you need orm feature
开始
from bustard.app import Bustard app = Bustard() @app.route('/') def helloword(request): return 'hello world' if __name__ == '__main__': app.run()
只需将其保存为hello.py并运行它
$ python hello.py WSGIServer: Serving HTTP on ('127.0.0.1', 5000) ...
现在访问http://localhost:5000,您应该会看到hello world。