Skip to content Skip to sidebar Skip to footer

Send Data To Html Dashboard In Python Flask While Having Dictionary In A Function Parameter

I want to send data to html in flask framework, i have a function which receives dictionary as a parameter, then there are several functions applied on dictionary. after that final

Solution 1:

Methods that Flask can route to don't take dictionaries as inputs, and the arguments they do take need to be matches by a pattern in the route. (See https://flask.palletsprojects.com/en/1.1.x/api/#url-route-registrations)

You'd get the same error if you changed

@app.route("/dashboard")defcalculate_full_eva_web(input:dict):

to

@app.route("/dashboard")defcalculate_full_eva_web(input):

Your path forward depends on how you want to pass data when you make the request. You can pass key/value pairs via URL parameters and retrieve them via the request.args object. That might be close enough to what you want. (You'll need to remove the argument declaration from calculate_full_eva_web())

Something like

from flask import request

@app.route('/dashboard')defcalculate_full_eva_web():
    input = request.args
    ...

Post a Comment for "Send Data To Html Dashboard In Python Flask While Having Dictionary In A Function Parameter"