diff options
author | mjfernez <mjfernez@gmail.com> | 2021-10-06 21:47:10 -0400 |
---|---|---|
committer | mjfernez <mjfernez@gmail.com> | 2021-10-06 21:47:10 -0400 |
commit | a800163aeae0998fa49f011664f32a6c348db886 (patch) | |
tree | 0e9dc38ad5c1fac12ee07f5f6c1fa5ab178330eb /server.py | |
parent | 6ddd97e1c39f55fe60fca093ca4fe610eca6d462 (diff) | |
download | ezcms-a800163aeae0998fa49f011664f32a6c348db886.tar.gz |
Adds gzip support by default
This commit adds Flask-Compress to the stack, an excellent module that
makes the site load faster. This also adds and amends the default
siteconfig
Diffstat (limited to 'server.py')
-rw-r--r-- | server.py | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -1,8 +1,10 @@ import os from flask import Flask from siteconfig import siteconfig +from flask_compress import Compress app = Flask(__name__) +compress = Compress() from views import * @@ -30,9 +32,10 @@ def setup(): app.config.update({'DOMAIN': siteconfig.DOMAIN}) app.config.update({'HOME_TITLE': siteconfig.HOME_TITLE}) - + app.config.update({'COMPRESS_MIMETYPES': siteconfig.COMPRESS_MIMETYPES}) # Setup needs to come first to be compatible with wsgi setup() if __name__ == "__main__": + compress.init_app(app) app.run() |