In my flask app I recreate a sqlite database at every start.
For this I use code as shown on the official webpage
My project structure looks like this
This exact use case happens to be the example used in the documentation for flask's open_resource
API call as well as the blueprint documentation linked in your question.
Specifically, the reference doc says:
To see how this works, consider the following folder structure:
/myapplication.py /schema.sql /static /style.css /templates /layout.html /index.html
If you want to open the schema.sql file you would do the following:
with app.open_resource('schema.sql') as f: contents = f.read() do_something_with(contents)