benselme / flask-mako

Provides support for Mako Templates in Flask.
40 stars 30 forks source link

config variable not included in template context #5

Open rhyek opened 11 years ago

rhyek commented 11 years ago

This variable is no longer available from a mako template since a change in how Flask manages it (https://github.com/mitsuhiko/flask/commit/f34c0281252bf1838e2ec24fe8b064b232a098ef).

In the meantime I'm using a context_processor which helps me get around this issue:

from flask import Flask

app = Flask(__name__)

@app.context_processor
def inject_config():
    return {'config': app.config}