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.

36 lines
759 B

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