2025年01月12日
flask装饰器route实现路由功能理解
利用装饰器的方式实现了路由函数,这是一个十分简单清晰的结构,而这个功能的实现,有着很大的学习意义
@appweb.route('index',methods=['GET','POST']
def static1():
return render_template('index.html')
看代码可以知道,通过appweb.route装饰了static1()函数,使其成为了路由函数
解析route装饰器源代码
def r
如何理解