A Django package which allows specifying custom paths to load managenent commands from.
Project description
Django Custom Commands
A Django package which allows specifying custom paths to load managenent commands from. This allows loading management commands which are not in Django apps.
Installation
pip install django-custom-commands
Usage
There's two things you need to do to use this package:
- Import
call_command
,get_commands
andexecute_from_command_line
fromdjango_custom_commands.management
instead ofdjango.core.management
. - Define a
CUSTOM_COMMAND_LOCATIONS
setting in your settings.
The CUSTOM_COMMAND_LOCATIONS
should be a list of strings, where each string points to a module where commands can appear. The string should be a dotted path, similar to how apps are defined. The package will then try to load commands from .management.commands
in those modules. For example if you have a command in src.demo.management.commands
, but you can't/don't want to make src.demo
a Django app, you would configure CUSTOM_COMMAND_LOCATIONS = ["src.demo"]
.
Running tests
poetry run pytest
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file django_custom_commands-0.1.0.tar.gz
.
File metadata
- Download URL: django_custom_commands-0.1.0.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 97bd7b8a76ef499a8f155784c6b3e41582272479ea44ebe1e57cec8396731ce6 |
|
MD5 | 7f9a02ff04623eb6ebfc41179af650a6 |
|
BLAKE2b-256 | 5fcf6b3dd421e304b8420b0b246794b712d582dfbfd061ea7aa0f05295bffa9f |
Provenance
The following attestation bundles were made for django_custom_commands-0.1.0.tar.gz
:
Publisher:
build.yml
on mikicz/django-custom-commands
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
django_custom_commands-0.1.0.tar.gz
- Subject digest:
97bd7b8a76ef499a8f155784c6b3e41582272479ea44ebe1e57cec8396731ce6
- Sigstore transparency entry: 145111465
- Sigstore integration time:
- Predicate type:
File details
Details for the file django_custom_commands-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: django_custom_commands-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 76f6e22b953adcac2797dd6d8f4e0c931ee08ad568f2dd114503c5f42cfd311e |
|
MD5 | 6566c2c1d70377b63368909984cdfe34 |
|
BLAKE2b-256 | 16cbf9f2082ec3ca959c5369b8b838756f96c6d5d1a2d0d33255556c5d7973e8 |
Provenance
The following attestation bundles were made for django_custom_commands-0.1.0-py3-none-any.whl
:
Publisher:
build.yml
on mikicz/django-custom-commands
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
django_custom_commands-0.1.0-py3-none-any.whl
- Subject digest:
76f6e22b953adcac2797dd6d8f4e0c931ee08ad568f2dd114503c5f42cfd311e
- Sigstore transparency entry: 145111468
- Sigstore integration time:
- Predicate type: