知识点回顾

1、flask依赖wsgi,实现wsgi的模块:wsgiref(django),werkzeug(flask),uwsgi(上线)

2、实例化Flask对象,里面是有参数的

app = Flask(__name__,template_folder='templates',static_url_path='/xxxxxx')

3、两种添加路由的方式

方式一:
  @app.route('/xxxx')  # @decorator
  def index():
     return "Index"
方式二:
  def index():
     return "Index"
  app.add_url_rule('/xxx', "n1", index)  #n1是别名 
View Code

相关文章:

  • 2021-03-31
  • 2021-04-08
猜你喜欢
  • 2021-09-15
  • 2021-11-30
  • 2021-07-23
  • 2022-12-23
  • 2022-01-23
  • 2022-01-09
相关资源
相似解决方案