I need the config variables in javascript in my flask application. Currently, I access the config variables via:
@app.route(\'/api/getconfigs/\')
def get_con
You could load the specific variable into your jinja2 globals like so:
app.jinja_env.globals.update(VARIABLENAME=config['VARIABLENAME'])
Then in an always included base-template load the variable into your javascript like so.
Or just throw the whole config into your jinja2 env like so:
app.jinja_env.globals.update(config=app.config)
And then insert the specific Variable only if it is found in config.
{% if config['VARIABLENAME'] %}
{% endif %}