2021年1月29日星期五

My flask app is fetching data from third party API , while deploying this app on EC2 , its getting hanged

app.py is running fine , on ubuntu EC2 virtual machine .

Screenshot

But , when I run it with EC2 DCN , its keep on loading , doesn't show any output.

flask import jsonify, Flask  import requests  import json  import pandas as pd  from flask import Flask, render_template    app = Flask(__name__,template_folder='template')    @app.route('/')  def index():      page = requests.get('https://www.nseindia.com/api/option-chain-indices?symbol=NIFTY' , headers = {'User-Agent': 'Mozilla/5.0'})      page=json.loads(page.text)      ce_values = [data['CE'] for data in page['records']['data'] if "CE" in data and data['expiryDate'] == "11-Feb-2021"]      ce_dt = pd.DataFrame(ce_values).sort_values(['strikePrice'])      return render_template('simple_VPS.html',  tables=[ce_dt.to_html(classes='data', header="true")])  

Any solutions ?

https://stackoverflow.com/questions/65952524/my-flask-app-is-fetching-data-from-third-party-api-while-deploying-this-app-on January 29, 2021 at 06:14PM

没有评论:

发表评论