My goal is to get arbitrary code to run after my Flask application is started. Here is what I\'ve got:
def run():
from webapp import app
app.run(debu
Use Flask-Script to run your app, then overwrite the runserver class/method like this
# manage.py
from flask.ext.script import Manager
from myapp import app
manager = Manager(app)
def crazy_call():
print("crazy_call")
@manager.command
def runserver():
app.run()
crazy_call()
if __name__ == "__main__":
manager.run()