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.1.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.1-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for django_tenants_smart_executor-0.1.1.tar.gz
Algorithm Hash digest
SHA256 bc6617a685295cde325ae93d38983201a3f425332fb9f1aa0204eb23187621e0
MD5 c89fe62b49a1a5f4491be43bc64aafcc
BLAKE2b-256 0cab62df12903c075eef01c59fd4a763aaf87d7321a0b8343cdd6aa1966bf17d

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_tenants_smart_executor-0.1.1.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.1-py3-none-any.whl.

File metadata

File hashes

Hashes for django_tenants_smart_executor-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5a0ed39bae9ec3f3c697284de85e44352d6a0ede709e6f1360372bc9c57f0dbf
MD5 808b451808b3cb7627d41f19e5f96bfe
BLAKE2b-256 2478dd88611c8ff550b1c2109810b326a2fb91b357b93e04eaef705ef5547836

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_tenants_smart_executor-0.1.1-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