import json import os import tomli from flask import render_template from app import create_app from column import Column from simplejsonstorage import SimpleJsonStorage APP = create_app() @APP.route("/") def index(): json_file = load_json_file() columns = [] for key, value in json_file.items(): column = Column(value["title"], value["urls"]) column.set_entries(value["entries"]) columns.append(column) return render_template("index.html", columns=columns) def load_json_file(): json_file = SimpleJsonStorage( os.path.join("data", "feeds.json"), os.path.join("data", "feeds.log") ) return json_file if __name__ == "__main__": APP.debug = True APP.run(port=8080)