Skip to Content
CLICommand ReferenceQuick Reference

CLI Commands Quick Reference

Fast reference guide for all Django-CFG management commands. Perfect for quick lookups!

Quick Overview

TaskCommandDescription
Create projectdjango-cfg create-project my_projectInitialize new Django-CFG project
Migrate databasespython manage.py migrate_allRun migrations on all databases
Run serverpython manage.py runserverStart enhanced development server
Create superuserpython manage.py superuser --email [email protected]Create admin user
Check settingspython manage.py check_settingsComprehensive diagnostics
Check endpointspython manage.py check_endpointsTest all API endpoints
Show URLspython manage.py show_urlsList all registered URLs
Test emailpython manage.py test_email --email [email protected]Send test email
RQ statspython manage.py rqstatsShow queue statistics
LLM balancepython manage.py check_llm_balanceCheck API credit balance

πŸš€ Project Setup

# Create new project django-cfg create-project my_project # Show Django-CFG info django-cfg info --verbose # Check settings python manage.py check_settings --verbose # Show current configuration python manage.py show_config --format json

πŸ—„οΈ Database Operations

# Migrate all databases (recommended) python manage.py migrate_all # Smart migration with auto-detection python manage.py migrator --auto # Dry run to preview migrations python manage.py migrate_all --check # Migrate specific database python manage.py migrator --database analytics_db

πŸƒ Development Server

# Enhanced development server python manage.py runserver # Custom port and host python manage.py runserver --port 3000 --host 0.0.0.0

πŸ‘€ User Management

# Create superuser (enhanced) python manage.py superuser --email [email protected] # Standard Django way python manage.py createsuperuser # Test OTP authentication python manage.py otp_test --email [email protected] python manage.py otp_test --phone "+1234567890"

πŸ§ͺ Testing & Monitoring

# Check all API endpoints health (auto-resolves parametrized URLs) python manage.py check_endpoints # Check with JSON output for CI/CD python manage.py check_endpoints --json # Check without automatic JWT authentication python manage.py check_endpoints --no-auth # Check specific endpoint python manage.py check_endpoints --url endpoints_status # API endpoint for monitoring curl http://localhost:8000/cfg/endpoints/ # Test email python manage.py test_email --email [email protected] # Test Telegram python manage.py test_telegram --message "Hello!"

πŸ”„ Background Tasks (Django-RQ)

# Start async worker # Start cron task scheduler # Start monitoring web interface # Start worker with specific queues # Start RQ worker python manage.py rqworker # Start RQ worker pool (multiple workers) python manage.py rqworker_pool # Start the RQ cron scheduler (one per project) python manage.py rqcron # Show queue statistics python manage.py rqstats # rqcron alive or queue starved? (exit 1 when not ok) python manage.py rq_cron_status

🌐 URLs & Routing

# Show all URLs (enhanced) python manage.py show_urls # Filter URLs python manage.py show_urls --filter "api/" # One namespace python manage.py show_urls --namespace cfg_accounts # List URLs (alternative) python manage.py list_urls --api

πŸ› οΈ Development Tools

# Run script with Django context python manage.py script my_script.py # Show project structure python manage.py tree --depth 3 # Create API token python manage.py create_token --user username --type api --expires 30 # Check settings python manage.py check_settings --verbose # Clear Constance cache python manage.py clear_constance

βš™οΈ Code Generation

# Generate FastAPI/SQLModel code from Django models python manage.py generate_fastapi # Generate API clients from generation.py python manage.py gen

πŸ“Š LLM Balance

# Check OpenAI/OpenRouter API balance python manage.py check_llm_balance

πŸ€– Telegram

# Start Telegram bot in polling mode python manage.py telegram_bot

πŸ”‘ Auth / OTP

# Reset OTP throttle for a user python manage.py otp_reset_throttle

🌍 Geo

# Populate geo/timezone data python manage.py geo_populate

πŸ—ΊοΈ Sitemap & IndexNow

# Registered sitemap sources, row counts, sample URLs python manage.py sitemap_inspect # IndexNow: what the next run would send; records nothing python manage.py indexnow_submit --dry-run # One run now (new, changed and removed URLs since the last accepted run) python manage.py indexnow_submit # Forget the state (next run records, sends nothing), or push specific URLs python manage.py indexnow_submit --reseed python manage.py indexnow_submit --url https://example.com/a/ --url https://example.com/b/

See IndexNow.

⏰ Cron Jobs

Commonly used commands in cron:

# Health check every 5 minutes */5 * * * * cd /path/to/project && python manage.py check_endpoints --json > /var/log/health.json

πŸ”— Command Chaining

Useful command combinations:

# Complete project setup django-cfg create-project my_project && \ cd my_project/projects/django && \ poetry install && \ poetry run python manage.py migrate && \ poetry run python manage.py createsuperuser # Check and migrate python manage.py check_settings && \ python manage.py migrate_all # Deploy workflow python manage.py check_settings --verbose && \ python manage.py migrate_all && \ python manage.py collectstatic --noinput # Development startup python manage.py migrate_all && \ python manage.py runserver

πŸ“‹ Command Categories

CategoryCommand CountMain Purpose
Core7Project setup, configuration, validation
Database3Migrations, database management
Testing4Endpoint health, email, telegram, OTP
Background Tasks5Django-RQ workers, scheduler, stats
Development6Server, scripts, testing
Code Generation2FastAPI, API client generation
LLM Balance1API balance
Telegram1Bot polling mode
Auth / OTP1Throttle reset
Geo1Timezone/geo data

πŸ’‘ Tips

Use Poetry for Project Commands

# Recommended poetry run python manage.py runserver # Also works python manage.py runserver

Always Check Before Deploy

python manage.py check_settings --verbose

Use Dry Run for Safety

python manage.py migrate_all --check

Test Integrations After Configuration

poetry run python manage.py test_email --email [email protected] poetry run python manage.py test_telegram --message "Deploy successful"

πŸ” Find More Information


Quick, focused, practical. Bookmark this page! πŸš€

Last updated on