First of all, I am very new at programming. I am trying to save a variable from bash shell
  >curl http://169.254.169.254/latest/meta-data/
this line would return data such as local-ipv4. And I am trying to use phython and flask to save those variables. I wrote
from flask import Flask, request
app  = Flask(__name__)
@app.route('/')
def testRequest():
  url1 = "http://169.254.169.254/latest/meta-data/"
  name1 = request.get(url1)
  nameText = name1.text
  return nameText
testOutput = testRequest()
print testOutput
But this gives me runtime error : working outside of the request context. can someone guide me to where to look for possible solution?
 
     
    