Multiple URL segment in Flask and other Python frameowrks

前端 未结 3 1755
夕颜
夕颜 2021-02-09 19:24

I\'m building an application in both Bottle and Flask to see which I am more comfortable with as Django is too much \'batteries included\'.

I have read through the routi

3条回答
  •  时光取名叫无心
    2021-02-09 20:02

    it works:

    @app.route("/login//")
    def login(user, password):
        app.logger.error('An error occurred')
        app.logger.error(password)
        return "user : %s password : %s" % (user, password)
    

    then:

    http://example.com:5000/login/jack/hi

    output:

    user : jack password : hi
    

提交回复
热议问题