Created
August 27, 2014 20:12
-
-
Save sleekslush/57f198bdaa6561fe55c3 to your computer and use it in GitHub Desktop.
Change jinja cache size in flask
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
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
woohoo! thanks