django.core.management.base BaseCommand Example Code

BaseCommand is a Django object for creating new Django admin commands that can be invoked with the manage.py script. The Django project team as usual provides fantastic documentation for creating your own commands. There are also some well-written community tutorials on the subject such as How to Create Custom Django Management Commands by Vitor Freitas.

Example 1 from django-filer

django-filer (project documentation) is a file management library for uploading and organizing files and images in Django's admin interface. The project also installs a few Django manage.py commands to make it easier to work with the files and images that you upload. The project's code is available under the BSD 3-Clause "New" or "Revised" open source license.

django-filer / filer / management / commands / generate_thumbnails.py