0

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

xpertdev
  • 1,293
  • 2
  • 6
  • 12
  • You need to show the full traceback – roganjosh Dec 01 '19 at 10:47
  • @roganjosh sure uploading – xpertdev Dec 01 '19 at 10:52
  • @roganjosh check please – xpertdev Dec 01 '19 at 10:58
  • That's no use to me because it doesn't show a single part of your own code that triggers the exception; everything is coming from `site-packages` so you're only showing how the library has failed to process your input... which isn't shown in that – roganjosh Dec 01 '19 at 12:10
  • `calculate_full_evaluation_web` is almost certainly your own function, but you haven't shown that. This issue is in your own code, it's not something from Flask/Jinja, it looks like a basic Python error – roganjosh Dec 01 '19 at 12:11
  • @roganjosh please can you check it now , to be specific i want to render the data with html, which data ? the data which is calculated in calculate_full_eval_web() – xpertdev Dec 01 '19 at 12:21
  • @roganjosh please can recheck the code . – xpertdev Dec 01 '19 at 12:23
  • Right, now I see the issue. You need to show your template. Presumably you have a form that calls that particular route, but you're not passing the argument there – roganjosh Dec 01 '19 at 12:24
  • @roganjosh the template is already in my code , i did'nt showed in my post before because it is very basic thing i know flask binds to templates folder and i have templates, but i edited my post and added templates which belongs to app. and also app.run(). The issue is when i didnt pass data in to calculate_full_eva_web, the flask is able to render my dashboard but when i pass data in calculate_full_eva_web. is throws error. – xpertdev Dec 01 '19 at 12:40

0 Answers0