Python Setup
What Python versions and frameworks does Scout support?
Scout supports Python 3.8+ with the following frameworks: - Django 3.2+ - Flask 0.10+ - FastAPI (via Starlette) - Celery 3.1+
Additional supported libraries include Bottle, Dash, Dramatiq, Falcon, Huey, Hug, RQ, and Starlette.
How do I install Scout for Django?
- Install the package:
pip install scout-apm- Configure in
settings.py:
INSTALLED_APPS = [
"scout_apm.django", # should be listed first
# ... other apps ...
]
SCOUT_MONITOR = True
SCOUT_KEY = "[YOUR KEY FROM SCOUT UI]"
SCOUT_NAME = "My Django App"- Deploy. Data appears within approximately five minutes.
How do I install Scout for Flask?
- Install the package:
pip install scout-apm- Configure in your Flask app:
from scout_apm.flask import ScoutApm
app = Flask(__name__)
ScoutApm(app)
app.config["SCOUT_MONITOR"] = True
app.config["SCOUT_KEY"] = "[YOUR KEY FROM SCOUT UI]"
app.config["SCOUT_NAME"] = "My Flask App"- Deploy.
How do I install Scout for FastAPI?
- Install the package:
pip install scout-apm- Attach the Scout middleware:
from fastapi import FastAPI
from scout_apm.api import Config
from scout_apm.async_.starlette import ScoutMiddleware
Config.set(
key="[YOUR KEY FROM SCOUT UI]",
name="My FastAPI App",
monitor=True,
)
app = FastAPI()
app.add_middleware(ScoutMiddleware)- Deploy.
How do I configure Scout on Heroku?
Scout works on Heroku without special configuration. Use environment variables:
heroku config:set SCOUT_NAME='My Heroku App'If using the Heroku Add-on, SCOUT_MONITOR and SCOUT_KEY are set automatically. You only need to add SCOUT_NAME.
Does Scout work with Docker?
Yes. Scout runs in Docker containers without special configuration. Consider using the Scout core-agent Docker image for easier container orchestration.