Multiple URL segment in Flask and other Python frameowrks

前端 未结 3 1747
夕颜
夕颜 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条回答
  •  闹比i
    闹比i (楼主)
    2021-02-09 20:02

    Splitting the string doesn't introduce any inefficiency to your program. Performance-wise, it's a negligible addition to the URL processing done by the framework. It also fits in a single line of code.

    @app.route('/')
    def my_view(fullurl):
        params = fullurl.split('/')
    

提交回复
热议问题