Flask Route

Sponsored · Your Podcast. Everywhere. Effortlessly. Share. Educate. Inspire. Entertain. You do you. We'll handle the rest. →
fanker
June 24, 2014

Flask Route

It talks about the route in flask

fanker

June 24, 2014

Annual Pro sale · Save $30

Have presentations of your own?

Share with private links, password protection, and more control over your work.

Transcript

10 slides
  1. eq: @app.route('/user/<username>') def show_user_profile(username): #show the user profile for that

    user return ‘User {0}‘.format(username) @app.route('/hello') def hello(): return 'Hello World'
  2. HTTP请求方法 HTTP (web 应用会话的协议)知道访问 URL 的不同 方法。默认情况下,路由只回应GET 请求,但是通 过给 route()

    装饰器提供 methods 参数可以更改这个 行为 @app.route('/login', methods=['GET', 'POST']) def login(): if request.method == 'POST': do_the_login() else: show_the_login_form()

Other Decks in Programming