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.2.0.tar.gz (4.5 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.2.0-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for django_tenants_smart_executor-0.2.0.tar.gz
Algorithm Hash digest
SHA256 7968b23a88e631c0d3c69462bb7c617b02ae0b82e3fc2790c5336e14053b61f2
MD5 5f9cfe56066f70ae9d2c9cbacd8ce434
BLAKE2b-256 eafb35b32b855c5f7dbe5387b7f5860f93c35cc315f289bcab0ddd1a3dc32c4c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for django_tenants_smart_executor-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 41aae65ecc589b0e700d80263e504ac6a37e969f9af1418619a893e4c7742304
MD5 3cf32b2b0624790d106e87a8138a9d3c
BLAKE2b-256 f63743e6293267066c760d48c6a913df7606aea4fb8c1d585732fd7fc1abbf6b

See more details on using hashes here.

Provenance

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