{"id":23748,"library":"flask-menu","title":"Flask-Menu","description":"Flask-Menu is a Flask extension that adds support for generating menus and navigation bars. Version 2.0.0 supports Python >=3.7, with a stable release cadence. It provides decorators and template helpers to define menus hierarchically and render them in templates.","status":"active","version":"2.0.0","language":"python","source_language":"en","source_url":"https://github.com/inveniosoftware/flask-menu","tags":["flask","menu","navigation","extension"],"install":[{"cmd":"pip install flask-menu","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Required as the framework","package":"Flask","optional":false}],"imports":[{"note":"Flask-Ext pattern was removed in Flask 2.0","wrong":"from flask.ext.menu import Menu","symbol":"Menu","correct":"from flask_menu import Menu"},{"note":"","wrong":null,"symbol":"register_menu","correct":"from flask_menu import register_menu"}],"quickstart":{"code":"from flask import Flask\nfrom flask_menu import Menu, register_menu\n\napp = Flask(__name__)\nMenu(app)\n\n@app.route('/')\n@register_menu(app, '.index', 'Home', order=0)\ndef index():\n    return 'Hello'\n\nif __name__ == '__main__':\n    app.run()","lang":"python","description":"Initialize the Menu extension and register a menu entry on a view function."},"warnings":[{"fix":"Use the `register_menu` decorator instead of `Menu.register_menu`.","message":"Version 2.0.0 removed the `Menu` class's `register_menu` method and uses the decorator `@register_menu` directly on view functions.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Use `{% active_menu %}` or `current_menu` in templates to highlight active items.","message":"The `active` key in the menu entry's attributes is no longer automatically set by the extension; you must use Jinja2 extensions to check current endpoint.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Apply `@register_menu` before `@app.route`.","message":"The `register_menu` decorator must be placed above the route decorator, otherwise the endpoint might not be registered.","severity":"gotcha","affected_versions":">=2.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use `from flask_menu import Menu` instead.","cause":"Using the deprecated Flask-Ext import style.","error":"ImportError: cannot import name 'Menu' from 'flask.ext.menu'"},{"fix":"Ensure `@register_menu` is placed directly above `@app.route` and that the endpoint matches the route's endpoint.","cause":"The decorator `@register_menu` is applied after the route decorator, or the view function is not defined.","error":"RuntimeError: The menu entry '...' is not registered because the endpoint '...' does not exist."}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}