Django Commands Suite is a Django app that provides a powerful suite of management commands for your projects.
It helps automate repetitive tasks such as:
- Database backup
- Creating superusers quickly
- Seeding fake data
- Cache management
- Logging command executions
- Running custom commands via Web Terminal
Install via pip:
pip install django-commands-suiteAdd it to INSTALLED_APPS in your Django settings:
INSTALLED_APPS = [
...
'django_commands_suite',
]Run migrations to create necessary tables:
python manage.py makemigrations django_commands_suite
python manage.py migrateView all DCS commands:
python manage.py dcs_helpCreate a superuser quickly:
python manage.py quick_superuserBackup your database:
python manage.py backup_dbSeed fake data for a model:
python manage.py dummy_data --model myapp.MyModel --count 10DCS provides a Web Terminal to run commands from the browser:
- URL:
/dcs/terminal/ - Supports custom DCS commands
- Example commands :
quick_superuser # Creates a superuser
All commands run via DCS (CLI or Web Terminal) are logged automatically using CommandLog.
This allows you to keep track of:
- Who ran a command
- When it was run
- Output and status (success or error)
Example usage of logging in a custom command:
from django_commands_suite.utils import log_command
log_command("my_command", {"option": "value"}, "success", "Command output here")You can define your own commands prefixed with dcs_ for Web Terminal usage.
Example:
from django.core.management.base import BaseCommand
from django_commands_suite.utils import log_command
class Command(BaseCommand):
help = "Say hello"
def handle(self, *args, **kwargs):
msg = "Hello from DCS!"
self.stdout.write(msg)
log_command("dcs_hello", {}, "success", msg)run_command allows you to run any Django management command from code and automatically logs its output and status in CommandLog.
run_command(command_name: str, *args, **kwargs)command_name(str): Django command name ("quick_superuser", etc.)*args: Positional arguments for the command**kwargs: Keyword arguments/options for the command
from django_commands_suite.utils import run_command
# Run quick_superuser
output = run_command("quick_superuser")
print(output)This function is great for automation scripts, seeders, or custom management tasks in Django projects.
Contributions are welcome!
Feel free to:
- Open issues
- Submit pull requests
- Suggest new commands
MIT License