Skip to main content

south-jurisdiction

Motivation

South isn’t great at handling differing requirements from multiple databases in a django application.

South assumes that there will at least be a south_migration_history table available at the point of running migrate against a given database.

This is fine when your django app is only dealing with one default database, but becomes much less pleasant when wanting to add extra database sources that perhaps south shouldn’t have jurisdiction over.

Let’s say your django.conf settings look something like:

DATABASES = {
    'default': {
        ...
        'NAME': 'my_own_db',
        ...
    },

    'super_secure': {
        ...
        'NAME': 'super_secure',
        ...
    }
}

You wouldn’t want syncdb to create tables in the super_secure DB, and that would be achieved by creating a database router, along with an allow_syncdb method and include that in a DATABASE_ROUTER setting. Done.

You also wouldn’t want migrate to do anything in super_secure. As it stands, south fails at this because the first thing it does is see if there are any migrations in the database by looking at the south_migration_history table. Because syncdb didn’t create this you get FAILURE.

Solution

South jurisdiction introduces a new setting to the django settings module:

SOUTH_MANAGED_DBS = []

This is intended to be populated with the keys of the databases that you want south to manage. In the above example it would read:

SOUTH_MANAGED_DBS = ['default']

Any attempt to migrate on a database not included in SOUTH_MANAGED_DBS is rejected gracefully.

If this setting is not included in your django settings module then all databases will be looked at for migration as normal.

Configuration

  • Add "south_jurisdiction" to INSTALLED_APPS in your settings, after the "south" app.

  • Use the new SOUTH_MANAGED_DBS setting available to you.

  • If you don’t want to run the south_jurisdiction tests, use the SKIP_SOUTH_TESTS setting in the same way as you do for south.

Metadata

Release files for south_jurisdiction 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for south_jurisdiction 0.1.2
File Size Uploaded Provenance
south_jurisdiction-0.1.2.tar.gz 2.9 kB Without provenance Details

Release files / south_jurisdiction-0.1.2.tar.gz

Download URL south_jurisdiction-0.1.2.tar.gz
Size 2.9 kB
Tags Source
SHA-256 checksum
How to use checksums
a8475b4a07a29e5117b6142f0c0b5a61bab87d90497c2cad301db6133db337f0
BLAKE2b-256 checksum
How to use checksums
d8793ee46bbe6a73815953919974eeb93a8ee0533316da7180cf17611a2e70d9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for south_jurisdiction 0.1.2

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

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