Django's management command framework is fully available in Pytigon, and Pytigon extends it with its own set of commands that handle project scaffolding, data import/export, and system maintenance.
All standard Django manage.py commands work in Pytigon projects:
python manage.py migrate
python manage.py createsuperuser
python manage.py shell
python manage.py test
python manage.py collectstatic
| Command | Purpose |
|---|---|
ptig init |
Initialize a new Pytigon project |
ptig run |
Start the development server with all components |
ptig manage |
Run Django management commands |
ptig pip |
Install Python packages in the Pytigon environment |
ptig tools |
Access development utilities |
| Command | Purpose |
|---|---|
import_from_db |
Import data from external databases |
export_data |
Export data in various formats |
load_example |
Load example/demo data |
| Command | Purpose |
|---|---|
make_i18n |
Generate internationalization files |
gen_docs |
Generate API documentation |
clear_cache |
Clear template and data caches |
Create custom commands by adding them to any application's management/commands/ directory:
# [app]/management/commands/send_daily_report.py
from django.core.management.base import BaseCommand
class Command(BaseCommand):
help = 'Sends the daily report to all subscribers'
def add_arguments(self, parser):
parser.add_argument('--date', type=str, help='Report date (YYYY-MM-DD)')
def handle(self, *args, **options):
date = options.get('date')
self.stdout.write(self.style.SUCCESS(f'Sending report for {date}'))
# ... actual logic
Management commands can be invoked from background tasks using the cmd proxy:
async def my_task(cmd):
cmd("send_daily_report", date="2025-01-15")
ptig CommandThe ptig command is Pytigon's unified CLI entry point:
ptig run # Start everything
ptig run server # Start only the server
ptig manage [django_cmd] # Run a Django management command
ptig pip install [package] # Install a Python package
ptig tools [tool_name] # Run a development tool