21 Commits

Author SHA1 Message Date
Grey Li
42d859534a Remove the use of before_first_request 2023-11-17 22:09:25 +08:00
Dosenpfand
6af24f5f44 Do not explicitly set SQLALCHEMY_TRACK_MODIFICATIONS for test/example 2022-10-28 11:28:50 +02:00
Dosenpfand
9e03576c94 Keep config for flask_sqlalchemy < 3 2022-10-24 19:35:47 +02:00
Dosenpfand
bfa48c5a2c Add support for flask_sqlalchemy >= 3.0.0 2022-10-24 18:59:28 +02:00
Jeff Widman
70abd78e55 Setup DB properly
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.
2020-03-09 10:01:59 -07:00
Jeff Widman
b92391d177 Switch to Flask's native CLI
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.
2020-02-17 23:57:04 -08:00
Jeff Widman
9c7db48362 Explicitly disable SQLALCHEMY_TRACK_MODIFICATIONS
This silences deprecation warnings.
Background: https://stackoverflow.com/a/33790196/770425

Note: This code can be removed once `flask_sqlalchemy` 3.0 ships, or any
release that includes
https://github.com/pallets/flask-sqlalchemy/pull/727.
2020-02-17 21:36:01 -08:00
Iuri de Silvio
2436239964 Additional cleanup of deprecated flask.ext.* magic imports. (#97) 2016-06-29 16:52:23 -07:00
Ivan Ivaschenko
903ed85f00 remove coding:utf-8 and add some style fixes 2013-11-29 00:17:15 +02:00
Ivan Ivaschenko
5710314252 pep8 formatting + coding: utf8 2013-11-28 18:31:29 +02:00
Matt Good
83523d6f59 Update example.py to use flask.ext compatibility imports. 2012-05-09 15:18:55 -07:00
Matt Good
f59705a7e7 Merge commit 'd886f5a606f26d78df457e7041c5666e0e5bbc6d' 2012-01-04 08:42:21 -08:00
Michael van Tellingen
1c594b9ba3 Attempt to fix the flask-debugtoolbar:
- 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
2011-10-17 21:27:51 +02:00
Dmitry Ishutkin
d886f5a606 add hosts setting
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.
2011-09-30 18:30:56 +08:00
Daniel Haaker
0a7d10f892 Apply flask-07-upgrade 2011-07-15 12:01:54 +02:00
Michael van Tellingen
469ed54369 Make the example work again 2011-02-24 21:12:07 +01:00
mvantellingen
e525b04848 Show all panels again in the example 2011-02-06 16:00:29 +01:00
Daniel Haaker
1f6f38bbec Add DEBUG_TB_PANELS setting, so you can change the ordering and add/remove panels 2011-02-04 23:54:46 +01:00
Michael van Tellingen
06efd26c31 Implement the ability to intercept redirects (like in the django debug toolbar) 2011-02-03 21:45:38 +01:00
mvantellingen
63a4eb022c Update example app 2011-02-02 22:44:32 +01:00
mvantellingen
3dac361ed4 Add setup.py script and an example app 2011-02-02 20:01:50 +01:00