title: Does Flask support some kind of life cycle methods?
body: <p>Sanic framework supports <a href="https://sanic.readthedocs.io/en/latest/sanic/middleware.html#listeners" rel="nofollow noreferrer">life cycle methods</a> such as <code>before_server_start</code>, <code>after_server_start</code>, <code>before_server_stop</code> and <code>after_server_stop</code>.</p>
  
  <p>Is there something similar in Flask like this ?</p>
  
  <p>I know there is a <code>before_request</code>  and <code>after_request</code>, but I'm looking for something before application is even started. I need to query a database to check if there is a certain entry in it. If there is, do some processing on that data and then run flask app.</p>