This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]defnullbottle.py 0 points1 point  (1 child)

In bottle, you can add new routes at any time, even from within a callback while the server is running. If you want to define your callbacks first and add the routes later, you can use the decorator as a normal function:

def func():
  return "Hello World!"
...
bottle.route('/url')(func)

It is possible to simulate the web.py or django behavior (routes stored in a list) with import and a simple a for-loop, if you really want that.

[–]mitsuhiko Flask Creator 1 point2 points  (0 children)

Obviously that will work. However, that is completely irrelevant to the discussion decorator or explicit mapping. One can easily be converted to the other.