Quickstart for Python + Flask
A sample application for using Rookout API to debug Python Flask apps.
Before following this guide we recommend reading the basic Python + Rookout guide.
- Clone and install dependencies:
git clone https://github.com/Rookout/deployment-examples.git cd deployment-examples/python-flask pip install -r requirements.txt
- Export organization token:
export ROOKOUT_TOKEN=<Your Rookout Token>
- Run the Flask server:
# starts the server (default URL: http://localhost:5000) python flask_rookout.py
Make sure everything worked: http://localhost:5000
Go to http://app.rookout.com and start debugging!
Rookout Integration explained
Rookout's Python SDK was installed as part of
pip install rook
Add the import to the main file of the application
Start the SDK using
rook.start()as early as possible in your code - it will look for the
ROOKOUT_TOKENenvironment variable, or can be passed as a parameter