CLI Commands Overview
Django-CFG provides management commands for development, testing, monitoring, and production operations.
Quick Start New to Django-CFG? Start with the Quick Reference for most common commands!
📚 Command Categories
🚀 Essential
Most Used Commands
# Check all API endpoints health
python manage.py check_endpoints
# Migrate all databases
python manage.py migrate_all
# Run development server
python manage.py runserver
# Create superuser
python manage.py superuser --email [email protected]
# Check settings and diagnostics
python manage.py check_settings🧪 Testing
Testing & Monitoring
# Endpoint health checker (production-ready)
python manage.py check_endpoints --json
# Test email
python manage.py test_email --email [email protected]
# Test Telegram
python manage.py test_telegram --message "Hello!"
Feature Highlight
check_endpoints includes:
- Auto-resolves parametrized URLs (
<int:pk>,<uuid:id>) - JWT auto-authentication
- Multi-database awareness
- REST API for monitoring at
/cfg/endpoints/
🛠️ Development
Development Tools
# Enhanced development server
python manage.py runserver --port 3000
# List all URLs
python manage.py list_urls --filter api
# Show project structure
python manage.py tree --depth 3
# Run custom script
python manage.py script my_script.py🚀 Production
Production Operations
# Check settings and diagnostics
python manage.py check_settings --verbose
# Migrate all databases
python manage.py migrate_all
# Check endpoint health
python manage.py check_endpoints📋 All Command Categories
🔧 Core Commands — 7 commands
🔧 Core Commands — 7 commands
Project setup, configuration validation, and system checks.
| Command | Description |
|---|---|
django-cfg create-project | Create new Django project with full setup |
django-cfg info | Show installation and system information |
show_config | Display current configuration |
check_settings | Comprehensive diagnostics |
show_urls | List all URL patterns |
migrate_all | Migrate all databases |
superuser | Create superuser |
🧪 Testing & Monitoring — 4 commands
🧪 Testing & Monitoring — 4 commands
Health checks, endpoint validation, and service testing.
| Command | Description |
|---|---|
check_endpoints | Production-ready endpoint health checker |
test_email | Test email configuration |
test_telegram | Test Telegram bot |
otp_test | Test OTP authentication |
REST API Available Access endpoint health via REST API:
curl http://localhost:8000/cfg/endpoints/🛠️ Development Tools — 6 commands
🛠️ Development Tools — 6 commands
Development server and productivity tools.
| Command | Description |
|---|---|
python manage.py runserver | Enhanced development server |
script | Run scripts with Django context |
tree | Show project structure |
list_urls | List all URL patterns |
create_token | Create API tokens |
clear_constance | Clear Constance cache |
🔄 Background Tasks — Django-RQ — 5 commands
🔄 Background Tasks — Django-RQ — 5 commands
Django-RQ worker management, scheduling, and monitoring.
| Command | Description |
|---|---|
rqworker | Start RQ worker process |
rqworker_pool | Start RQ worker pool (multiple workers) |
rqcron | Run the project’s schedules and delayed jobs on RQ’s native cron (one per project) |
rqstats | Show RQ queue statistics |
rq_cron_status | Tell a dead rqcron from a starved queue; exits 1 when not ok |
⚙️ Code Generation — 2 commands
⚙️ Code Generation — 2 commands
Generate code from Django models for other frameworks.
| Command | Description |
|---|---|
generate_fastapi | Generate FastAPI/SQLModel code from Django models |
gen | Generate API clients from generation.py (TypeScript, Python, Go, Swift) |
📊 LLM Balance — 1 command
📊 LLM Balance — 1 command
LLM provider balance check.
| Command | Description |
|---|---|
check_llm_balance | Check OpenAI/OpenRouter API balance |
🤖 Telegram — 1 command
🤖 Telegram — 1 command
Telegram bot management.
| Command | Description |
|---|---|
telegram_bot | Start Telegram bot in polling mode |
🔑 Auth / OTP — 1 command
🔑 Auth / OTP — 1 command
Authentication and OTP utilities.
| Command | Description |
|---|---|
otp_reset_throttle | Reset OTP throttle for a user |
🌍 Geo — 1 command
🌍 Geo — 1 command
Geographic and timezone data management.
| Command | Description |
|---|---|
geo_populate | Populate geo/timezone data |
🎯 Common Workflows
Initial Project Setup
# 1. Create project
django-cfg create-project "My Project"
cd my_project
# 2. Check settings
python manage.py check_settings --verbose
# 3. Migrate databases
python manage.py migrate_all
# 4. Create superuser
python manage.py superuser --email [email protected]
# 5. Check endpoint health
python manage.py check_endpoints
# 6. Run server
python manage.py runserverPre-Deployment Checklist
# 1. Check settings
python manage.py check_settings --verbose
# 2. Check endpoint health
python manage.py check_endpoints
# 3. Test integrations
python manage.py test_email --email [email protected]
# 4. Run migrations
python manage.py migrate_all
# 5. Collect static files
python manage.py collectstatic --noinputCI/CD Integration
# Health check in pipeline
python manage.py check_endpoints --json | jq '.errors'
# Exit if unhealthy
test $(python manage.py check_endpoints --json | jq '.errors') -eq 0Production Tip Add endpoint health checks to your monitoring:
# Cron job - every 5 minutes
*/5 * * * * python manage.py check_endpoints --json > /var/log/health.json💡 Best Practices
Isolation
Use Poetry for Isolation
# Recommended
poetry run python manage.py runserver
poetry run python manage.py check_endpoints
# Also works but less isolated
python manage.py runserverValidation
Always Validate
# Before deployment
python manage.py check_settings --verbose
# Before migrations
python manage.py migrate_all --checkTesting
Test After Changes
# Test email
python manage.py test_email --email [email protected]
# Test messaging
python manage.py test_telegram --message "Deploy successful"
# Test endpoints
python manage.py check_endpointsMonitoring
Continuous Monitoring
# Endpoint health check
curl http://localhost:8000/cfg/endpoints/ | jq
# Check all endpoints
python manage.py check_endpoints --json🔗 Quick Navigation
| I want to… | Go to… |
|---|---|
| Find a command quickly | Quick Reference |
| Set up a new project | Core Commands |
| Monitor API health | Testing & Monitoring |
| Start development | Development Tools |
| Manage background tasks | Background Tasks (above) |
| Generate code | Code Generation (above) |
Next Steps
- 📖 New to Django-CFG? Start with Quick Reference
- 🧪 Need monitoring? See Testing & Monitoring
- 🚀 Ready to deploy? Check Core Commands
One powerful CLI.