I have a python program which is running Flask. I noticed a strange thing, it looks like the program is running twice, which I do not want.
Here is the file for starting the program(runserver.py, in the root folder /):
from myapp import app
if __name__ == "__main__":
print "woho"
app.run(host='0.0.0.0',debug=True)
When running this, I can see two "woho" in the terminal, indicating that something is strange.
in the folder /myapp I have __init__.py:
from flask import Flask
app = Flask(__name__)
import myapp.views
and then in my views.py (also in /myapp) I have all the views like:
from myapp import app
from flask import render_template
@app.route('/')
def index():
return render_template('index.html')