Rendering data to html in flask: how to pass a data through app.route function flask?

158 Views Asked by At

I have a function in which i get all calculation stuff, and i want to render these calculation stuff on my dashboard. i am unable to load my dashboard page when i pass (input:dict) to main_function(), I want to render my dashboard with these data, and then i can use jinja stuff on html to catch these values there. Tried many methods. Any expert Please..

Thanks

imports ...
from other file import other_functions
from other file import other_functions_2
from other file import other_functions_3
app = Flask(__name__, template_folder='templates/')
@app.route("/dashboard")
def calculate_full_eva_web(input:dict):
   calculate_gap = other_functions(input)
   calculate_matrix = other_functions_2(input)
   average = other_functions_3(input)
   data = dict{'calculate_gap':calculate_gap, 'calculate_matrix':calculate_matrix,'average':average}
   return render_template('pages/dashboard.html', data = data) 

if __name__ == "__main__":
    app.run(debug=True)

Error.
Traceback:
TypeError: calculate_full_eva_web() missing 1 required positional argument: 'input'

TRACEBACK

0

There are 0 best solutions below