This is the code I deployed on pythonanywhere
from flask import Flask, jsonify
import estimateR
app = Flask(__name__)
# to make flask point to our current app
app.app_context().push()
reproductive_nos = estimateR.get_reproductive_nos()
dates = estimateR.get_dates()
response = list()
for i in range(len(dates)):
d = dict()
d["date"] = dates[i]
d["R"] = reproductive_nos[i]
response.append(d)
response.reverse()
json_response = jsonify({'values': response})
@app.route('/', methods=['GET'])
def return_data():
return json_response
if __name__ == '__main__':
app.run()
END
Now, reproductive_nos and dates are gloabl variables imported from another file. These variables change as they're computed by making some API calls in which data changes. My question is will this change be reflected on the global variables? Or will they remain static? Thanks
[edit by admin: formatting]