下一代 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()

你可能感兴趣的:(python)