app.py is running fine , on ubuntu EC2 virtual machine .
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 ?
question from:
https://stackoverflow.com/questions/65952524/my-flask-app-is-fetching-data-from-third-party-api-while-deploying-this-app-on 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…