inveniosoftware / flask-breadcrumbs

Flask-Breadcrumbs is a Flask extension that adds support for generating site breadcrumb navigation.
https://flask-breadcrumbs.readthedocs.io
Other
30 stars 23 forks source link

Flask-Breadcrumbs Not working #42

Open piyushgohel opened 7 years ago

piyushgohel commented 7 years ago

Hello,

I have implement Flask-Breadcrumbs menu in my flask app. but it will give me key error like "KeyError: 'menu'"

I will show you some code: Py File

from flask_breadcrumbs import Breadcrumbs, register_breadcrumb,default_breadcrumb_root
Breadcrumbs(app=app)
default_breadcrumb_root(user_blueprint,'.')

@user_blueprint.route('/user/register')
@register_breadcrumb(user_blueprint, '.user.register', 'Home')
def register():
     error = None
     return render_template('register.html',error=error)

register.html File

    <div>
        {%- for breadcrumb in breadcrumbs -%}
            <a href="{{ breadcrumb.url }}">{{ breadcrumb.text }}</a>
            {{ '/' if not loop.last }}
        {%- endfor -%}
    </div>  

keyerror menu werkzeug debugger

jirikuncar commented 7 years ago

Can you please provide full source code? It looks like you haven't initialized neither Breadcrumbs extension.