user4985526
user4985526

Reputation:

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?

Upvotes: 2

Views: 1117

Answers (1)

davidism
davidism

Reputation: 127260

request.blueprint will be the current blueprint name if the request is being handled by a blueprint.

Upvotes: 4

Related Questions