简体   繁体   中英

Is there any way to know current url is in a specific blueprint in flask?

in my flask app I can use a blueprint to register lots of routes..

@myblueprint.route('/first')
@myblueprint.route('/two')
@myblueprint.route('/three')

my problem is that I need to know current url in in a specific blueprint.so I can give it a class='active' css effect in jinja template? So is there any way I can do using flask 0.10.0?

如果请求正在由蓝图处理,则request.blueprint将是当前蓝图名称。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM