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 servercli runserverStart enhanced development server
Create superusercli superuser --email [email protected]Create admin user
Check settingspython manage.py check_settingsComprehensive diagnostics
Check endpointspython manage.py check_endpointsTest all API endpoints
Show URLscli show-urlsList all registered URLs
Test emailcli test-email --to [email protected]Send test email
Start workerrearq main:rearq workerStart background task worker
Start gRPC serverpython manage.py rungrpcStart async gRPC server
D1 statuspython manage.py cf_statusCheck Cloudflare D1 connection
Streamlit adminpython manage.py run_streamlitStart Streamlit admin server
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 yaml

🗄️ 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 --dry-run # Migrate specific database python manage.py migrator --database analytics_db

🏃 Development Server

# Enhanced development server cli runserver # With ngrok tunnel (for webhooks) python manage.py runserver_ngrok # Custom port and host cli runserver --port 3000 --host 0.0.0.0

👤 User Management

# Create superuser (enhanced) cli 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 cli test-email --to [email protected] # Test Telegram cli test-telegram --message "Hello!"

🔄 Background Tasks (Django-RQ)

# Start async worker rearq main:rearq worker # Start cron task scheduler rearq main:rearq timer # Start monitoring web interface rearq main:rearq server # Start worker with specific queues rearq main:rearq worker --queues default,high,low # Test task processing python manage.py test_tasks # Start RQ worker python manage.py rqworker # Start RQ worker pool (multiple workers) python manage.py rqworker_pool # Start RQ scheduler python manage.py rqscheduler # Show queue statistics python manage.py rqstats # Clean stale job locks python manage.py rq_cleanup_locks

🌐 URLs & Routing

# Show all URLs (enhanced) cli show-urls # Filter URLs cli show-urls --pattern "api/" # Include admin URLs cli show-urls --include-admin # List URLs (alternative) python manage.py list_urls --output urls.txt

🛠️ Development Tools

# Run script with Django context python manage.py script my_script.py # Show project structure python manage.py tree --depth 3 # Generate components python manage.py generate model Product name:str price:decimal # Create API token python manage.py create_token username --expires-in 30 # Check settings python manage.py check_settings --verbose # Clear Constance cache python manage.py clear_constance

🌐 gRPC / Communication

# Start async gRPC server python manage.py rungrpc # Compile .proto files python manage.py compile_proto # Generate proto definitions from Django models python manage.py generate_protos # Create D1 schema tables for gRPC python manage.py create_grpc_d1_schema

☁️ Cloudflare D1

# Show D1 connection status python manage.py cf_status # Sync Django users to D1 python manage.py cf_sync_users # View D1 operation logs python manage.py d1_logs # Create D1 schema for RQ events python manage.py create_rq_d1_schema # Create D1 schema for Centrifugo logs python manage.py create_centrifugo_d1_schema

📡 Centrifugo

# Generate typed Centrifugo clients (Python, TS, Go, Swift) python manage.py generate_centrifugo_clients

🖥️ Streamlit Admin

# Scaffold a new Streamlit admin app python manage.py create_streamlit_app # Start Streamlit admin server python manage.py run_streamlit # Generate Streamlit pages from models python manage.py gen_streamlit

⚙️ Code Generation

# Generate FastAPI/SQLModel code from Django models python manage.py generate_fastapi # Generate standalone API client python manage.py generate_client

📊 LLM & Monitoring

# Check OpenAI/OpenRouter API balance python manage.py check_llm_balance # Clean old monitor events python manage.py monitor_cleanup

🤖 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

⏰ 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_ngrok

📋 Command Categories

CategoryCommand CountMain Purpose
Core7Project setup, configuration, validation
Database3Migrations, database management
Testing4Endpoint health, email, telegram, OTP
Background Tasks9Django-RQ workers, scheduler, stats
Development8Server, ngrok, scripts, testing
gRPC4gRPC server, proto compilation
Cloudflare D15D1 status, sync, logs, schemas
Centrifugo3WebSocket clients, publishing
Streamlit3Admin panel scaffolding, server
Code Generation2FastAPI, API client generation
LLM & Monitoring2API balance, event cleanup
Telegram1Bot polling mode
Auth / OTP1Throttle reset
Geo1Timezone/geo data

💡 Tips

Use Poetry for Project Commands

# Recommended poetry run cli 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 --dry-run

Test Integrations After Configuration

poetry run cli test-email --to [email protected] poetry run cli test-telegram --message "Deploy successful"

🔍 Find More Information


Quick, focused, practical. Bookmark this page! 🚀

Last updated on