Django documentation

This document is for Django's SVN release, which can be significantly different from previous releases. Get old docs here: Django 1.0

Writing custom django-admin commands

New in Django 1.0: Please, see the release notes

Applications can register their own actions with For example, you might want to add a action for a Django app that you’re distributing.

To do this, just add a management/commands directory to your application. Each Python module in that directory will be auto-discovered and registered as a command that can be executed as an action when you run


In this example, the explode command will be made available to any project that includes the blog application in settings.INSTALLED_APPS.

The module has only one requirement -- it must define a class called Command that extends

For more details on how to define your own commands, look at the code for the existing commands, in /django/core/management/commands.


Having trouble? We'd like to help!