Allow apps to provide their own commands
|Reported by:||toddobryan||Owned by:||russellm|
|Component:||Core (Management commands)||Version:||master|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
This patch allows users to create arbitrary commands in each app that can be invoked by django-admin.py.
Inside an app, users create a management.commands.my_command module for each command they'd like to add that must include a subclass of django.core.management.base.BaseCommand called Command. A command is invoked with app_name.my_command, where app_name is the path to the app provided in the INSTALLED_APPS setting.
Commands installed in this way are automatically plugged into the help system provided that the user has provided the Django settings correctly, either by using manage.py, setting the DJANGO_SETTINGS_MODULE environment variable, or by using the --settings option to django-admin.py.
Change History (6)
Changed 8 years ago by toddobryan
comment:1 Changed 8 years ago by toddobryan
- Needs documentation unset
- Needs tests unset
- Owner changed from nobody to toddobryan
- Patch needs improvement unset
comment:4 in reply to: ↑ 3 Changed 8 years ago by russellm
- Owner changed from toddobryan to russellm
- Triage Stage changed from Unreviewed to Accepted