I am trying to disable the Jinja2 template cache. I looked around a bit and found that there is a cache_size parameter for the jinja environment. I am using the following:
app.jinja_env = jinja2.Environment( cache_size = 0, loader = jinja2.FunctionLoader(utils.load_template) )
I use a custom bootloader to dynamically load domain-based templates (the application serves multiple domains). Unfortunately, using this, it looks like it is overriding Jinja's default filters and built-in functions - using
@app.route(...) def page(): render_template('template')
I get an UndefinedError: 'url_for' is undefined error UndefinedError: 'url_for' is undefined . What is the right way to do this?
source share