知识点回顾

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

相关文章: