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.

35 lines
740 B

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