Skip to main content

Allows multiple apps to override the same management command in Django

Project description

© 2014 Thomas Khyn

MCMO stands for ‘Management Command Multiple Override’ Allows multiple apps to override the same management command in Django

Usage

  1. Install using your prefered method

  2. replace the line:

    from django.core import management

by:

from django_mcmo import management

in your manage.py file

  1. You can now use applications that concurrently define overrides for django.core management commands. Both commands will be called.

Alternative usage

If your manage.py is automatically generated (e.g. if you are using buildout and djangorecipe), simply make sure that the statement:

import django_mcmo

is executed before calling django.management.execute_from_command_line.

Importing the package patches the django.core.management module, which functions are then multiple-override enabled.

Limitations

The same-name overrides must derive from the same Command class, or at least from the same Command base class (AppCommand, LabelCommand or NoArgsCommand).

In practice, same-name command will only be met when two apps override a core django management command. They will therefore derive from the same Command class, and cause no issue (except if the same options are defined in the two commands).

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-mcmo-1.0.zip (8.4 kB view details)

Uploaded Source

Built Distribution

django_mcmo-1.0-py2.7.egg (6.7 kB view details)

Uploaded Source

File details

Details for the file django-mcmo-1.0.zip.

File metadata

  • Download URL: django-mcmo-1.0.zip
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for django-mcmo-1.0.zip
Algorithm Hash digest
SHA256 9310e14f92cbedc2eca96edf5b443eb8fa3a4546baf364e0c4e5097ed5c48efe
MD5 648a4e6586c8fce82f5b5455b442e30f
BLAKE2b-256 05df6c3ca28bf08a2ac6ee0da568e2c2626d9ff3a8e55baea41bcc3b0136673e

See more details on using hashes here.

File details

Details for the file django_mcmo-1.0-py2.7.egg.

File metadata

File hashes

Hashes for django_mcmo-1.0-py2.7.egg
Algorithm Hash digest
SHA256 26ce721d800eebc1b9a164c31c73b50dad2111c67cdaa972c92ef5d24a744aa1
MD5 b8b9c36d9eb1c41bd19b4f33c39a9bde
BLAKE2b-256 4aef0b585ffffdc2c3127a1201cfe219a017ec56d38678f51d88e8b21a041c96

See more details on using hashes here.

Supported by

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