I have a python script that returns a dictionary. I am trying to access that dictionary in a python flask file and display it in an html file using a template. When I try and load the webpage, I get "Something went wrong :-(" If I comment out the flask components of the file and add a print statement and tell the function to run, it will print out the dictionary from the other script. If I use a simple script containing a test dictionary and remap the flask python file to this, it will display the website. I feel like I am missing something obvious, but I can't see it. The computation python file is giving me the directory, which can be read and printed by the app file, but it won't pass the data on to the html page when setup that way.
# flask app to launch scoreboard
from flask import Flask, render_template
import harknessScoreboard
#import testDict
app = Flask(__name__)
app.config["DEBUG"] = True
@app.route("/scoreboard")
def scoreboard():
weeklyPointsDict = harknessScoreboard.main()
#weeklyPointsDict = testDict.main()
#weeklyPointsDict = {"Julian": 25, "Bob": 26, "Dan": 47, "Cornelius": 3}
return render_template("scoreboard.html", weeklyPointsDict=weeklyPointsDict)
#print(weeklyPointsDict)
#scoreboard()
harknessScoreboard.main() returns the dictionary when I print without the flask parts of the script, but won't seem to pass anything to the return statement.