> ## Documentation Index
> Fetch the complete documentation index at: https://docs.subtrace.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Python Flask + Subtrace

> Connect your Flask backend to Chrome DevTools using Subtrace

You can connect your Flask backend to Chrome DevTools using Subtrace with just
one line of code. With Subtrace, you can inspect the status, headers, payload,
and latency of all API requests so you can debug way faster.

To begin with, install Subtrace:

```python theme={null}
pip install subtrace
```

For this guide, we'll use the following `hello.py` Flask app as an example:

```python theme={null}
# Add this line to install Subtrace on your Flask server
import subtrace

from flask import Flask                                                                                             

app = Flask(__name__)
                         
@app.route("/")          
def hello_world():
    return "<p>Hello, World!</p>"
```

Before we move on to the next step, get a `SUBTRACE_TOKEN` from the Subtrace
[dashboard](https://subtrace.dev/dashboard) for free and set it as an
environment variable.

```bash theme={null}
# get a tracer token for free at https://subtrace.dev/dashboard
export SUBTRACE_TOKEN=
```

Now use the `flask` command to start the server on port 5000:

```bash theme={null}
flask --app hello run
```

Send some requests to `localhost:5000` to see them in Chrome DevTools in the
Subtrace dashboard!
