I have a complex Flask-based web app. There are lots of separate files with view functions. Their URLs are defined with the @app.route('/...') decorator. Is there a way to get a list of all the routes that have been declared throughout my app? Perhaps there is some method I can call on the app object?
I have a complex Flask-based web app. There are lots of separate files with
Share
All the routes for an application are stored on
app.url_mapwhich is an instance ofwerkzeug.routing.Map. You can iterate over theRuleinstances by using theiter_rulesmethod:See Display links to new webpages created for a bit more information.