How to implement plotly.js with python for dynamic plotting

@app.route(’/home/’, methods=[‘POST’, ‘GET’])
def home():
cmpname = ""
if request.method ==“POST”:
cmpname = request.form[“text”].upper()
else:
return render_template(‘home.html’)
api_key = "abc"
data=[]
try:
data = quandl.get(str(“WIKI/” + cmpname), authtoken = api_key)
except:
return "Either you entered wrong symbol of the company or company is not registered with us."
return render_template(“home.html”, data = data)