Skip to main content

django-strava

PyPI version CI

A reusable Django app for the Strava V3 API under the 2026 Developer Program, backed by django-healthdatamodel: activities land as Workout rows (with metadata) and, optionally, heart-rate / cadence / power streams as Record series — nothing Strava-shaped is stored except the OAuth connection itself.

Strava API notes (June 2026 Developer Program)

  • Every new app lands in the Standard tier: 1 athlete by default, self-upgradeable to 10 in the API settings dashboard, no review needed. The developer account must hold an active Strava subscription.
  • Rate limits (default): 200 requests/15 min & 2,000/day overall; 100/15 min & 1,000/day for reads. Doubled after the 10-athlete upgrade. The client retries 429s and exposes the latest X-RateLimit-* headers.
  • The API host moves to a new domain in 2027 (available 2027-01-04, mandatory 2027-06-01). Set STRAVA_API_BASE_URL to cut over without a code change.
  • Auth uses Authorization: Bearer headers and the new POST /oauth/revoke endpoint exclusively — nothing here depends on the transports retired in 2027.

Quick start

  1. Install alongside the storage layer:

    pip install django-strava
    
  2. Add both apps to INSTALLED_APPS:

    INSTALLED_APPS = [
        ...,
        "healthdatamodel",
        "strava",
    ]
    
  3. Configure credentials from your Strava API application:

    STRAVA_CLIENT_ID = "..."
    STRAVA_CLIENT_SECRET = "..."
    STRAVA_REDIRECT_URI = "https://example.com/strava/callback/"
    # optional:
    STRAVA_CONNECT_SUCCESS_URL = "/"  # default: /admin/
    STRAVA_DEFAULT_SCOPES = ["read", "activity:read_all", "profile:read_all"]
    STRAVA_WEBHOOK_VERIFY_TOKEN = "..."  # only if using webhooks
    STRAVA_API_BASE_URL = "https://www.strava.com/api/v3"  # 2027 host cutover knob
    
  4. Route the app and migrate:

    (path("strava/", include("strava.urls")),)
    
    python manage.py migrate
    
  5. Send a logged-in user to /strava/connect/ to run the OAuth flow, then sync:

    python manage.py sync_strava --user alice --days 30
    python manage.py sync_strava --days 7 --streams --stream-limit 10
    

Webhooks

Route strava/webhook/ publicly, set STRAVA_WEBHOOK_VERIFY_TOKEN, then:

python manage.py create_strava_subscription https://example.com/strava/webhook/

Every event POST emits strava.signals.event_received; connect a receiver that calls (or enqueues) strava.webhooks.process_event, which re-fetches the activity through the authenticated API and ingests/deletes accordingly, and marks connections disconnected on athlete deauthorization events.

Demo project

A click-through demo lives in demo/ (login → connect → sync → browse):

uv sync --group dev
export STRAVA_CLIENT_ID=... STRAVA_CLIENT_SECRET=...
uv run python manage.py migrate
uv run python manage.py createsuperuser
uv run python manage.py runserver

Set your Strava application's Authorization Callback Domain to localhost, then open http://localhost:8000/.

Metadata

Release files for django-strava 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-strava 0.2.1
File Size Uploaded Provenance
django_strava-0.2.1.tar.gz 20.6 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for django-strava 0.2.1
File Interpreter ABI Platform
django_strava-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 48.9 kB

Release files / django_strava-0.2.1.tar.gz

Download URL django_strava-0.2.1.tar.gz
Size 20.6 kB
Tags Source
SHA-256 checksum
How to use checksums
cf7c4d8316b902477648c6d3efcaa6a70f3dcc11ccb8f815a47145efea8ce03a
BLAKE2b-256 checksum
How to use checksums
091132a277313347120d8e7c39516f615a42e9c66757bccb219bf04f386026fc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 29, 2026.

Transparency log

Release files / django_strava-0.2.1-py3-none-any.whl

Download URL django_strava-0.2.1-py3-none-any.whl
Size 28.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
895a23c5f4b3b050985d66650fc610e58f998d14dd2a2d3fdd47213c41bfe985
BLAKE2b-256 checksum
How to use checksums
c7489bfcefaf93e77a312a67590370eb29f1a00c330ba06c3820af56688bf392
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 29, 2026.

Transparency log

Security for django-strava 0.2.1

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for django_strava-0.2.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 29, 2026.

Transparency log

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page