When you import app
you are importing the app
module (which most likely has an app
name inside it which points to your Flask app. What you want to do is import that name and register it:
from wtf.app import app as application
# Note the extra app
It is worth noting that you do not need to do this manually - simply run Flask using the run
method on the app and pass the argument debug=True
to get the same behavior:
from wtf.app import app
if __name__ == '__main__':
app.run(debug=True)