When I switched over to `flask run` entrypoint in b92391d177,
I forgot that the `if name==__main__` code no longer triggers.
So the SQLite in-memory database wasn't getting created for the example
app.
This moves the DB creation to a werkzeug/Flask hook that runs before the
first request to the app, so that the DB table is created when we query
it.
Also updated the test which worked fine previously, but this is more
idiomatic.
Drop `flask_script` in favor of Flask's native CLI:
* https://flask.palletsprojects.com/en/master/cli/
This also requires changing the tests so that `pytest` mocks the env var
`FLASK_ENV` so that the test app starts in development mode. Unlike
normal test apps, we _do_ want development/debug mode, in addition to
testing mode.
- Rename the package to flask_debugtoolbar
- Fix importing of the panels so that the views in the panels are correctly registered in the blueprint
There is still one major problem in the sqlalchemy panel where we are not able to get the SQLAlchemy reference
app.config['DEBUG_TB_HOSTS']
Example: app.config['DEBUG_TB_HOSTS'] = ( '127.0.0.1', '::1' )
If the request’s REMOTE_ADDR is not in this list, the toolbar will not
be displayed and the exception handler will not be active. This should
be a tuple. Default: (). Empty list remains backward compatibility. If
DEBUG_TB_HOSTS not specified in app.config, the debug toolbar is shown
for all addresses.