CLI Commands Quick Reference
Fast reference guide for all Django-CFG management commands. Perfect for quick lookups!
Quick Overview
| Task | Command | Description |
|---|---|---|
| Create project | django-cfg create-project my_project | Initialize new Django-CFG project |
| Migrate databases | python manage.py migrate_all | Run migrations on all databases |
| Run server | python manage.py runserver | Start enhanced development server |
| Create superuser | python manage.py superuser --email [email protected] | Create admin user |
| Check settings | python manage.py check_settings | Comprehensive diagnostics |
| Check endpoints | python manage.py check_endpoints | Test all API endpoints |
| Show URLs | python manage.py show_urls | List all registered URLs |
| Test email | python manage.py test_email --email [email protected] | Send test email |
| RQ stats | python manage.py rqstats | Show queue statistics |
| LLM balance | python manage.py check_llm_balance | Check 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
| Category | Command Count | Main Purpose |
|---|---|---|
| Core | 7 | Project setup, configuration, validation |
| Database | 3 | Migrations, database management |
| Testing | 4 | Endpoint health, email, telegram, OTP |
| Background Tasks | 5 | Django-RQ workers, scheduler, stats |
| Development | 6 | Server, scripts, testing |
| Code Generation | 2 | FastAPI, API client generation |
| LLM Balance | 1 | API balance |
| Telegram | 1 | Bot polling mode |
| Auth / OTP | 1 | Throttle reset |
| Geo | 1 | Timezone/geo data |
π‘ Tips
Use Poetry for Project Commands
# Recommended
poetry run python manage.py runserver
# Also works
python manage.py runserverAlways Check Before Deploy
python manage.py check_settings --verboseUse Dry Run for Safety
python manage.py migrate_all --checkTest 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
- Core Commands - Project setup, configuration
- Background Tasks - Django-RQ commands
- Development - Development tools
- Commands Overview - Full categorized list of all 50+ commands
Quick, focused, practical. Bookmark this page! π
Last updated on