Skip to main content

Executors for django-tenants which check whether any migrations need running before running them, making it faster.

Project description

Django Tenants Smart Executor

When using django-tenants, migrations can be quite slow when you have a lot of tenants. This is the case even if there are actually no migrations to run. This package provides executors that skip running the migrations for a tenant if there are no migrations to run. If there's no migratuons to run, the schema_migrated signal is still triggered.

Installation

Install using pip (or your package manager of choice):

pip install django-tenants-smart-executor

And configure the GET_EXECUTOR_FUNCTION in your settings.py:

GET_EXECUTOR_FUNCTION = "django_tenants_smart_executor.load_executor"

Usage

When you run migrations when all tenants are migrated, the output will look something like this:

$ python manage.py migrate_schemas
No migrations needed for schema public, only triggering signals
No migrations needed for schema test, only triggering signals

The multiprocessing executor is also supported.

$ python manage.py migrate_schemas --executor multiprocessing
No migrations needed for schema public, only triggering signals
No migrations needed for schema test, only triggering signals

Project details


Download files

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

Source Distribution

django_tenants_smart_executor-0.1.0.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

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

django_tenants_smart_executor-0.1.0-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file django_tenants_smart_executor-0.1.0.tar.gz.

File metadata

File hashes

Hashes for django_tenants_smart_executor-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a3d719ca598bf2661179ca936d60526b61379f7d4a0d21fb85c666814b3f7b6b
MD5 88bed4a0a3704c5dc4f1abc6839ef2f3
BLAKE2b-256 21379f3d4bc623cd59dc4de188759d9ab473696551fdefe433892760682f7e4b

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_tenants_smart_executor-0.1.0.tar.gz:

Publisher: build.yml on xelixdev/django-tenants-smart-executor

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_tenants_smart_executor-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for django_tenants_smart_executor-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 13613cf595ab8ec43ad1eeb3b05f157fde17ab6b0b7bf18cf283065da85ecfd2
MD5 0db79c3ad0d47579652493c99f9fc3cc
BLAKE2b-256 8ce0b81e500092e5900ac96f190045cb7bffb288ff6804b9584529ac9ebe6e90

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_tenants_smart_executor-0.1.0-py3-none-any.whl:

Publisher: build.yml on xelixdev/django-tenants-smart-executor

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

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page