R
R
rysev-a2015-04-09 09:13:38
Flask
rysev-a, 2015-04-09 09:13:38

How to generate a menu from a flask-menu list?

I am using flask-menu like this

@app.route('/first')
@menu.register_menu(app, '.first', 'First', order=0)
def first():
    return render_template('menu.html')

But how can I make it generated and not write @menu.register_menu for each element ...
For example, for such a route
@app.route("/content/<page_name>")
def a_page(page_name):
...

...
if I have a list of pages page?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question