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, etc.).

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",
            },
        },
    ],
}

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.
  • restore: Supports -timestamp, -generation, -index for point-in-time recovery.
  • Daemon control (info, list, register, unregister, start, stop): Communicate with a running replicate daemon over IPC.

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

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 both django-litestream and django-litestream-vfs (the VFS extension and Python integration).

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

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

License

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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_litestream-0.5.15.tar.gz (11.2 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

django_litestream-0.5.15-py3-none-win_arm64.whl (36.4 MB view details)

Uploaded Python 3Windows ARM64

django_litestream-0.5.15-py3-none-win_amd64.whl (39.8 MB view details)

Uploaded Python 3Windows x86-64

django_litestream-0.5.15-py3-none-manylinux2014_x86_64.musllinux_1_1_x86_64.whl (38.8 MB view details)

Uploaded Python 3musllinux: musl 1.1+ x86-64

django_litestream-0.5.15-py3-none-manylinux2014_aarch64.musllinux_1_1_aarch64.whl (35.9 MB view details)

Uploaded Python 3musllinux: musl 1.1+ ARM64

django_litestream-0.5.15-py3-none-macosx_11_0_arm64.whl (37.2 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

django_litestream-0.5.15-py3-none-macosx_10_9_x86_64.whl (39.9 MB view details)

Uploaded Python 3macOS 10.9+ x86-64

django_litestream-0.5.15-py3-none-any.whl (10.8 kB view details)

Uploaded Python 3

File details

Details for the file django_litestream-0.5.15.tar.gz.

File metadata

  • Download URL: django_litestream-0.5.15.tar.gz
  • Upload date:
  • Size: 11.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for django_litestream-0.5.15.tar.gz
Algorithm Hash digest
SHA256 acb83b2dea0d0dbfe53d35b6292b705f49fe773152cd1b42a0512c8c8985871f
MD5 13c175081ccf315a35b0dae900656f53
BLAKE2b-256 9e91d701e71ba6339f81813023f393c0abac387374402e502af70e522a9b3892

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_litestream-0.5.15.tar.gz:

Publisher: publish.yml on Tobi-De/django-litestream

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file django_litestream-0.5.15-py3-none-win_arm64.whl.

File metadata

File hashes

Hashes for django_litestream-0.5.15-py3-none-win_arm64.whl
Algorithm Hash digest
SHA256 45cbd3a6d5a2618e7d95bb55abffec33daf4ba016a105dcf811bac0f703df8c7
MD5 d8ff7a020b59fd5f157b3d9c454b1497
BLAKE2b-256 d1b9d668d08d960448c73654a6c499fad54d932206bce9d6c61e8e7088482364

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_litestream-0.5.15-py3-none-win_arm64.whl:

Publisher: publish.yml on Tobi-De/django-litestream

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file django_litestream-0.5.15-py3-none-win_amd64.whl.

File metadata

File hashes

Hashes for django_litestream-0.5.15-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 eb3241c8deecc951c6c40f55606224ef0733ab779163fc4875eb72207ddd5073
MD5 67e5f7ac4f8cdf92435540584c2d527d
BLAKE2b-256 fbb7534f9c4f66fc90ac85d334925929a913f014eecafd010cfcb668bcce767b

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_litestream-0.5.15-py3-none-win_amd64.whl:

Publisher: publish.yml on Tobi-De/django-litestream

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file django_litestream-0.5.15-py3-none-manylinux2014_x86_64.musllinux_1_1_x86_64.whl.

File metadata

File hashes

Hashes for django_litestream-0.5.15-py3-none-manylinux2014_x86_64.musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 214dc3749b0b18d1e311643995476e44686c06d5c973864624955512dd436c1c
MD5 907843dfe272d240bb4085ab2e9a7ac8
BLAKE2b-256 b160e136b329eb9ce2749423d8ea9f494665eb4b010e69328befd10051e54d1c

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_litestream-0.5.15-py3-none-manylinux2014_x86_64.musllinux_1_1_x86_64.whl:

Publisher: publish.yml on Tobi-De/django-litestream

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file django_litestream-0.5.15-py3-none-manylinux2014_aarch64.musllinux_1_1_aarch64.whl.

File metadata

File hashes

Hashes for django_litestream-0.5.15-py3-none-manylinux2014_aarch64.musllinux_1_1_aarch64.whl
Algorithm Hash digest
SHA256 066c99103e5f08d237fce6a350ab9bf9963d2dd6223330b97bd0a0dcaeac67bb
MD5 48d062b192ff23dce6c02af9cdaafe33
BLAKE2b-256 48cae1ebbb8df7316b756b38ac1a9441b12de569ceae6345f976a60d438eb4af

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_litestream-0.5.15-py3-none-manylinux2014_aarch64.musllinux_1_1_aarch64.whl:

Publisher: publish.yml on Tobi-De/django-litestream

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file django_litestream-0.5.15-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for django_litestream-0.5.15-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 937f0a6dfe495e6435ae82dfb078c23c7fb121e829a92cfa648b4f22ffd4985e
MD5 69ce7acab42bd446c8ef8fc1bb4282ed
BLAKE2b-256 9eedcff6f1eaae17ff2278fe4e81a0822ea0fa71f22554bb5016c41d8a1c55f0

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_litestream-0.5.15-py3-none-macosx_11_0_arm64.whl:

Publisher: publish.yml on Tobi-De/django-litestream

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file django_litestream-0.5.15-py3-none-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for django_litestream-0.5.15-py3-none-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 ac138f8b1e4f85255af0649a95c09438afb35bcb92590c9ae765af97b637d79d
MD5 64cc80a5834aa0300dc418b70ddae649
BLAKE2b-256 547478cd04d49d7cbf1e3b3a6f7f6bcd6d468d1cc2bcfab9b7a0c3c7b5f6bbc7

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_litestream-0.5.15-py3-none-macosx_10_9_x86_64.whl:

Publisher: publish.yml on Tobi-De/django-litestream

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file django_litestream-0.5.15-py3-none-any.whl.

File metadata

File hashes

Hashes for django_litestream-0.5.15-py3-none-any.whl
Algorithm Hash digest
SHA256 7239e6373231b6210b32b2c10e5649913804e5e0d1d1a0d42086d56da16ba03f
MD5 c15788d65ec6a7b5107457aa1871229a
BLAKE2b-256 8365ccb602ead091d79379fa399cb52676263352680a4cf0333fda3fad3caee3

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_litestream-0.5.15-py3-none-any.whl:

Publisher: publish.yml on Tobi-De/django-litestream

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.6.0

2 files

0.5.16

8 files

This release

0.5.15 This release

8 files

0.5.13

8 files

0.5.12

8 files

0.5.11.post6

6 files

0.5.11.post5

6 files

0.5.11.post4

6 files

0.5.11.post3

6 files

0.5.11.post2

6 files

0.5.11.post1

6 files

0.5.11

6 files

0.5.2

2 files

0.5.1

2 files

0.5.0

2 files

0.3.2

2 files

0.3.1

2 files

0.3.0

2 files

0.2.0

2 files

0.1.6

2 files

0.1.5

2 files

0.1.4

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

0.0.1

2 files

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