Skip to main content

django-litestream

PyPI - Version PyPI - Python Version PyPI - Versions from Framework Classifiers MIT License

Django integration for Litestream, the SQLite replication tool. The Litestream binary is bundled in platform-specific wheels — no manual download needed. All upstream commands are available as python manage.py litestream <command>.

Note: This package tracks Litestream's upstream version. The initial release is 0.5.11, matching Litestream v0.5.11. Wrapper-only fixes (no Litestream update) use PEP 440 post-releases like 0.5.11.post1.

Installation

pip install django-litestream

Add to INSTALLED_APPS:

INSTALLED_APPS = [
    "django_litestream",
]

The binary is installed automatically on supported platforms (Linux/macOS x86_64 & arm64). On unsupported platforms, set a custom path:

LITESTREAM = {
    "bin_path": "/usr/local/bin/litestream",
}

Configuration

Configuration is generated dynamically from Django settings — no YAML file needed.

# settings.py
LITESTREAM = {
    "path_prefix": "",      # prepended to S3 replica paths
    "bin_path": "...",      # custom binary path (optional)
    "dbs": [                # databases to replicate
        {"path": "default"},
    ],
}

All Litestream config options are supported (addr, logging, mcp-addr, access-key-id, shutdown-timeout, etc.) and forwarded verbatim; only path_prefix, bin_path and vfs are consumed by the wrapper.

Database aliases

Use Django database aliases instead of file paths wherever db_path is required:

python manage.py litestream restore default        # instead of /path/to/db.sqlite3
python manage.py litestream sync default

Auto-generated replicas

If no replica is specified for a database, an S3 replica is auto-generated using environment variables:

LITESTREAM = {
    "dbs": [{"path": "default"}],
}
# Uses: LITESTREAM_REPLICA_BUCKET, LITESTREAM_ACCESS_KEY_ID, LITESTREAM_SECRET_ACCESS_KEY

Explicit replica config:

LITESTREAM = {
    "dbs": [
        {
            "path": "default",
            "replica": {
                "type": "s3",
                "bucket": "my-bucket",
                "path": "db.sqlite3",
            },
        },
    ],
}

Multiple databases with path_prefix

DATABASES = {
    "default": {"ENGINE": "django.db.backends.sqlite3", "NAME": BASE_DIR / "db.sqlite3"},
    "cache":  {"ENGINE": "django.db.backends.sqlite3", "NAME": BASE_DIR / "cache.sqlite3"},
}

LITESTREAM = {
    "path_prefix": "myproject",
    "dbs": [
        {"path": "default"},           # → myproject/db.sqlite3
        {
            "path": "cache",
            "replica": {
                "type": "s3",
                "bucket": "my-cache-bucket",
                "path": "cache.sqlite3",
            },
        },
    ],
}

Per-database options

Every database-level option is passed through untouched; the wrapper only resolves the path alias and fills in an S3 replica when neither replica nor replicas is set:

LITESTREAM = {
    "dbs": [
        {
            "path": "default",
            "snapshot": {"interval": "6h", "retention": "168h"},
            "monitor-interval": "5s",
            "checkpoint-interval": "1m",
        },
    ],
}

dir-based entries (directory watching) are forwarded as-is, so pattern, recursive, watch, meta-dir, etc. work too. Durations use Go syntax (6h, 168h, 30m), not 7d/1w.

Custom commands

These commands are unique to django-litestream — they don't exist in upstream Litestream.

litestream config

Display the generated configuration in YAML format.

python manage.py litestream config

Useful for verifying your setup before running replication.

litestream verify

Checks backup integrity end-to-end: writes a verification row, waits for replication, restores the latest backup, and confirms the row exists.

python manage.py litestream verify default

Upstream commands

All Litestream commands are exposed as management commands. Run python manage.py litestream to see the full list. Key notes:

  • replicate: Run in production via a process manager. Use -exec to wrap your application server. -force-snapshot and -enforce-retention require -once.

  • restore: Supports -timestamp and -txid for point-in-time recovery, -f for follow mode (with -follow-interval), -integrity-check for post-restore verification, and -json for machine-readable output.

  • ltx: Use -level with 0-9 or all; -json for scripting. wal is a deprecated alias.

  • Daemon control (info, list, register, unregister, start, stop, sync): Communicate with a running replicate daemon over its control socket. These commands do not read a config file, so the socket must be enabled where the daemon runs:

    LITESTREAM = {
        "socket": {"enabled": True, "path": "/var/run/litestream.sock"},
        "dbs": [{"path": "default"}],
    }
    

The only difference from upstream is that Django database aliases work anywhere db_path is expected.

A database may appear only once in LITESTREAM["dbs"]: Litestream rejects duplicate dbs[].path values at load time, and aliases are resolved to paths before the config is written.

VFS Read Replicas

Read-only access to cloud-stored replicas without downloading the entire database. Pages are fetched on-demand.

pip install django-litestream[vfs]

This installs django-litestream, the django-litestream-vfs Django integration, and the upstream litestream-vfs package, which bundles the compiled VFS extension.

Setup

# settings.py
from django_litestream_vfs import get_vfs_databases

LITESTREAM = {
    "dbs": [{"path": "default"}],
    "vfs": {
        "prod_replica": "s3://mybucket/db.sqlite3",
    },
}

DATABASES = {
    "default": {
        "ENGINE": "django.db.backends.sqlite3",
        "NAME": BASE_DIR / "db.sqlite3",
    },
    **get_vfs_databases(),  # adds VFS replicas
}

Usage

User.objects.using("prod_replica").all()  # read-only, on-demand page fetch

Each alias is opened with its replica URL in the connection URI, so any number of replicas can be read in one process.

Per-alias tuning is available by using a dict instead of a plain URL:

LITESTREAM = {
    "vfs": {
        "prod_replica": "s3://mybucket/db.sqlite3",
        "analytics": {
            "url": "s3://analytics/analytics.db",
            "poll_interval": "5s",   # how often to look for new LTX files
            "cache_size": 33554432,  # page cache in bytes
        },
    },
}

The extension also exposes SQL functions on VFS connections: litestream_time(), litestream_txid(), litestream_lag(), and litestream_set_time(timestamp) for point-in-time reads.

VFS replicas are read-only. Only x86_64 and arm64 supported. Multiple storage backends supported (S3, GCS, Azure Blob, local files, SFTP, NATS, WebDAV).

Note: the upstream litestream-vfs package ships version-independent wheels (py3-none-*), so it installs on Python 3.8+ including 3.14.

License

MIT. The bundled Litestream binary uses the Apache 2.0 license.

Metadata

Release files for django-litestream 0.5.18.post3

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-litestream 0.5.18.post3
File Size Uploaded Provenance Actions
django_litestream-0.5.18.post3.tar.gz 13.5 kB With provenance Details for django_litestream-0.5.18.post3.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for django-litestream 0.5.18.post3
File Actions
django_litestream-0.5.18.post3-py3-none-win_arm64.whl Python 3 none Windows ARM64 Details for django_litestream-0.5.18.post3-py3-none-win_arm64.whl
django_litestream-0.5.18.post3-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for django_litestream-0.5.18.post3-py3-none-win_amd64.whl
django_litestream-0.5.18.post3-py3-none-manylinux2014_x86_64.musllinux_1_1_x86_64.whl Python 3 none Linux musl 1.1+ x86-64, Linux glibc 2.17+ x86-64 Details for django_litestream-0.5.18.post3-py3-none-manylinux2014_x86_64.musllinux_1_1_x86_64.whl
django_litestream-0.5.18.post3-py3-none-manylinux2014_aarch64.musllinux_1_1_aarch64.whl Python 3 none Linux glibc 2.17+ ARM64, Linux musl 1.1+ ARM64 Details for django_litestream-0.5.18.post3-py3-none-manylinux2014_aarch64.musllinux_1_1_aarch64.whl
django_litestream-0.5.18.post3-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details for django_litestream-0.5.18.post3-py3-none-macosx_11_0_arm64.whl
django_litestream-0.5.18.post3-py3-none-macosx_10_9_x86_64.whl Python 3 none macOS 10.9+ x86-64 Details for django_litestream-0.5.18.post3-py3-none-macosx_10_9_x86_64.whl
django_litestream-0.5.18.post3-py3-none-any.whl Python 3 none any Details for django_litestream-0.5.18.post3-py3-none-any.whl

Total release size: 322.7 MB

Release files / django_litestream-0.5.18.post3.tar.gz

Download URL django_litestream-0.5.18.post3.tar.gz
Size 13.5 kB
Tags Source
SHA-256 checksum
How to use checksums
ea7b5ad84eed8ce49e00cacfa0da6d8dd1723dca5d325d02f3a9197ecd4125a0
BLAKE2b-256 checksum
How to use checksums
0952951a7be4dacef331500350a70866ff77310974e65bcb735a071f2c6b52cd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 26, 2026.

Transparency log

Release files / django_litestream-0.5.18.post3-py3-none-win_arm64.whl

Download URL django_litestream-0.5.18.post3-py3-none-win_arm64.whl
Size 51.6 MB
Tags Python 3 Windows ARM64
SHA-256 checksum
How to use checksums
60bdc5a9edd7dc6eaa709fe0a8b8c2834255bbed57cbfe18fdd478a6e6f54297
BLAKE2b-256 checksum
How to use checksums
dc2f658bfc42ca388c6d0790d696d98f23eeda5b41815d32e21ed80d3c4c125f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 26, 2026.

Transparency log

Release files / django_litestream-0.5.18.post3-py3-none-win_amd64.whl

Download URL django_litestream-0.5.18.post3-py3-none-win_amd64.whl
Size 56.1 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
4712dcac810d640bbf78840ad08e9e503a8ce43a5dfb70f26a0495931e9ef4b9
BLAKE2b-256 checksum
How to use checksums
95475fe76410e28d45e515b12d128cc0365fae3608616ce5a67cc6f8b87a1881
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 26, 2026.

Transparency log

Release files / django_litestream-0.5.18.post3-py3-none-manylinux2014_x86_64.musllinux_1_1_x86_64.whl

Download URL django_litestream-0.5.18.post3-py3-none-manylinux2014_x86_64.musllinux_1_1_x86_64.whl
Size 54.7 MB
Tags Linux glibc 2.17+ x86-64 Linux musl 1.1+ x86-64 Python 3
SHA-256 checksum
How to use checksums
b577745c2bf6a33bf25c27681fdb745e6bc6a872667418e139ac774bc30d8d7e
BLAKE2b-256 checksum
How to use checksums
0d6cc166c0437f6dba89beb6587851e7d4f45b4300c62b6a9eac9a7be785f391
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 26, 2026.

Transparency log

Release files / django_litestream-0.5.18.post3-py3-none-manylinux2014_aarch64.musllinux_1_1_aarch64.whl

Download URL django_litestream-0.5.18.post3-py3-none-manylinux2014_aarch64.musllinux_1_1_aarch64.whl
Size 51.0 MB
Tags Linux glibc 2.17+ ARM64 Linux musl 1.1+ ARM64 Python 3
SHA-256 checksum
How to use checksums
9f0b3c4a7b738ed6891b2ebd99074f8e1c9930cc02bc60db271d876d453cd187
BLAKE2b-256 checksum
How to use checksums
6a3c1b91bbf1d85c9cdf261de5e1e45955f0a86b69e9d5382cc51cc6c3d7c04d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 26, 2026.

Transparency log

Release files / django_litestream-0.5.18.post3-py3-none-macosx_11_0_arm64.whl

Download URL django_litestream-0.5.18.post3-py3-none-macosx_11_0_arm64.whl
Size 52.9 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
62ba848a311b42ce542dee5d4100f5dc9ed0f317e695388256549abe2ac14073
BLAKE2b-256 checksum
How to use checksums
956fc73936149fc47b767ca5be9ac47d6fdd926cb342bd428e23b75910d0833e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 26, 2026.

Transparency log

Release files / django_litestream-0.5.18.post3-py3-none-macosx_10_9_x86_64.whl

Download URL django_litestream-0.5.18.post3-py3-none-macosx_10_9_x86_64.whl
Size 56.4 MB
Tags Python 3 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
4d0b3b4bbce4a741d42aa31a584e177ad5878a7ae4bae98c9d4e553bd38f6187
BLAKE2b-256 checksum
How to use checksums
cbca5e6374fe890416c768485cbaa0ca36abc8000eeec8c808f72ddae1365905
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 26, 2026.

Transparency log

Release files / django_litestream-0.5.18.post3-py3-none-any.whl

Download URL django_litestream-0.5.18.post3-py3-none-any.whl
Size 12.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8dff3ce49e9c053a469c63232d37a87a95f6999a4b1b3889f367275e1ffc4fde
BLAKE2b-256 checksum
How to use checksums
a87fff9cc268d64ab2eaa9a7ee114bbb5841ce8e2c88d8c38f478c66862ddcd2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 26, 2026.

Transparency log

Security for django-litestream 0.5.18.post3

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 8 files in this release have been uploaded with provenance metadata.

Select from 8 files

Attestation for django_litestream-0.5.18.post3.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 Nov 26, 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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release
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