crunk-columns is a PESOS style website maker
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
756 B

12 months ago
import tomli
import os
import json
from flask import render_template
from simplejsonstorage import SimpleJsonStorage
12 months ago
from app import create_app
from column import Column
APP = create_app()
@APP.route("/")
def index():
json_file = load_json_file()
12 months ago
columns = []
for key, value in json_file.items():
print(key)
column = Column(value["title"], value["urls"])
column.set_entries(value["entries"])
12 months ago
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
12 months ago
if __name__ == "__main__":
APP.debug = True
APP.run(port=5000)