A similar but slightly different approach using the context processor:
In python / bulb:
@app.context_processor def utility_functions(): def print_in_console(message): print str(message) return dict(mdebug=print_in_console)
In jinja2, use it anywhere:
{{ mdebug("any text or variable") }}
source share