Skip to content

Instantly share code, notes, and snippets.

@sleekslush
Created August 27, 2014 20:12
Show Gist options
  • Save sleekslush/57f198bdaa6561fe55c3 to your computer and use it in GitHub Desktop.
Save sleekslush/57f198bdaa6561fe55c3 to your computer and use it in GitHub Desktop.
Change jinja cache size in flask
from flask import Flask as DefaultFlask
class Flask(DefaultFlask):
def create_jinja_environment(self):
self.jinja_options = dict(self.jinja_options)
if 'JINJA_CACHE_SIZE' in self.config:
self.jinja_options['cache_size'] = self.config['JINJA_CACHE_SIZE']
return super(Flask, self).create_jinja_environment()
@shreyansb
Copy link

woohoo! thanks

@rturk
Copy link

rturk commented May 15, 2015

Can this be implemented without a new Class? Like a module?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment