I\'m running Flask through thescript, below (run.py)
#!flask/bin/python
from app import app
app.run(debug=True)
When runni
This error is because of you are not defining app and directly using app
Solution is add this line in your code : app Flask(__name__)
Example: app.py
from flask import Flask
#You need to use following line [app Flask(__name__]
app = Flask(__name__)
@app.route('/')
def index():
return "Hello World with flask"
if __name__ == '__main__':
app.run(port=5000,debug=True)