aboutsummaryrefslogtreecommitdiffstats
path: root/server.py
diff options
context:
space:
mode:
authormjfernez <mjfernez@gmail.com>2021-10-14 20:14:53 -0400
committermjfernez <mjfernez@gmail.com>2021-10-14 20:14:53 -0400
commitc583a69362f86fcc8e1b35a45a06dd8377d6308f (patch)
tree30609b89aa2781c95fc5c04ff96db3ab063e16e7 /server.py
parentf7668243b7a55d1f69d508b3baaf891055715f63 (diff)
downloadezcms-c583a69362f86fcc8e1b35a45a06dd8377d6308f.tar.gz
Adds RSS auto-generation for files in 'site'
This commit adds rss_generator.py which contains the main logic for indexing the site directory and generating a feed on startup. It serves as a sort of ad-hoc database which is accessed when /feed.xml is requested. Also corrects various typos, README nonsense, and expands the config options for RSS. Instances of './templates/site' have been replaced with the general BASE_DIR variable in the siteconfig.
Diffstat (limited to 'server.py')
-rw-r--r--server.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/server.py b/server.py
index 545f4b6..c5522b9 100644
--- a/server.py
+++ b/server.py
@@ -6,6 +6,7 @@ from flask import Flask
from siteconfig import siteconfig
from flask_compress import Compress
from flask_caching import Cache
+from rss_generator import RSS_Item, get_rss_channel
app = Flask(__name__)
compress = Compress()
@@ -41,11 +42,12 @@ def setup():
app.config.update(
{'COMPRESS_MIMETYPES': siteconfig.COMPRESS_MIMETYPES}
)
+ app.config.update({'RSS_CHANNEL': get_rss_channel()})
# Setup needs to come first to be compatible with wsgi
setup()
+compress.init_app(app)
+cache.init_app(app)
if __name__ == "__main__":
- compress.init_app(app)
- cache.init_app(app)
app.run()