aboutsummaryrefslogtreecommitdiffstats
path: root/server.py
diff options
context:
space:
mode:
authormjfernez <mjfernez@gmail.com>2021-10-06 21:47:10 -0400
committermjfernez <mjfernez@gmail.com>2021-10-06 21:47:10 -0400
commita800163aeae0998fa49f011664f32a6c348db886 (patch)
tree0e9dc38ad5c1fac12ee07f5f6c1fa5ab178330eb /server.py
parent6ddd97e1c39f55fe60fca093ca4fe610eca6d462 (diff)
downloadezcms-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.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/server.py b/server.py
index 1908ad3..8937d4b 100644
--- a/server.py
+++ b/server.py
@@ -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()