Flask-Failsafe
A failsafe for the Flask reloader.
The Flask reloader works great until you make a syntax error and it fails importing your app. This extension helps keep you working smoothly by catching errors during the initialization of your app, and provides a failsafe fallback app to display those startup errors instead.
To use it, run your app via a small script script with a factory function to initialize your app:
from flask_failsafe import failsafe @failsafe def create_app(): # note that the import is *inside* this function so that we can catch # errors that happen at import time from myapp import app return app if __name__ == "__main__": create_app().run()
The @failsafe decorator catches any errors calling create_app() and returns a fallback app that will instead display the Flask error debugger.
If you use Flask-Script, you can pass the same @failsafe-decorated factory function to the Manager() class:
from flask.ext.script import Manager, Server
from flask_failsafe import failsafe
@failsafe
def create_app():
from myapp import app
return app
manager = Manager(create_app)
manager.add_command("runserver", Server())
if __name__ == "__main__":
manager.run()
Changes
0.2 (2014-01-03)
Python 3 support (thanks to Asger Drewsen for the help)
0.1 (2012-09-14)
Initial release
Metadata
Release files for Flask-Failsafe 0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| Flask-Failsafe-0.2.tar.gz | 2.9 kB | Without provenance | Details for Flask-Failsafe-0.2.tar.gz |
Release files / Flask-Failsafe-0.2.tar.gz
| Download URL | Flask-Failsafe-0.2.tar.gz |
|---|---|
| Size | 2.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
10df61daaad241b5970504acb98fb26375049fe1adaf23f28bc9e257c28f768b
|
|
BLAKE2b-256 checksum How to use checksums |
76d8d968f17fcca8b9e006ff537ae25b10293c906fbaf15d14a222affcc19cc3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for Flask-Failsafe 0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.