下一代 Python 異步web框架

使用方法

import web

class UserModel(web.Model):
    username: str
    password: str
    
class Index:
    async def get(self, name):
        return f"Hello, {name}!"
    
if __name__ == '__main__':
    urls = {
        "/{name}", Index,
        "/users", UserModel,
    }
    app = web.Application(urls)
    app.run()
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章