---
title: Quick Reference
description: Django-CFG CLI quick reference commands. Command-line interface for quick reference with examples, options, and production workflows.
sidebar_label: Quick Reference
sidebar_position: 1
keywords:
  - django-cfg quick reference
  - django-cfg command quick reference
  - cli quick reference
---

# 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 | `cli runserver` | Start enhanced development server |
| Create superuser | `cli superuser --email admin@test.com` | 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 | `cli show-urls` | List all registered URLs |
| Test email | `cli test-email --to admin@test.com` | Send test email |
| Start worker | `rearq main:rearq worker` | Start background task worker |
| Start gRPC server | `python manage.py rungrpc` | Start async gRPC server |
| D1 status | `python manage.py cf_status` | Check Cloudflare D1 connection |
| Streamlit admin | `python manage.py run_streamlit` | Start Streamlit admin server |
| RQ stats | `python manage.py rqstats` | Show queue statistics |
| LLM balance | `python manage.py check_llm_balance` | Check API credit balance |

## 🚀 Project Setup

```bash
# 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

```bash
# 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

```bash
# 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

```bash
# Create superuser (enhanced)
cli superuser --email admin@example.com

# Standard Django way
python manage.py createsuperuser

# Test OTP authentication
python manage.py otp_test --email user@test.com
python manage.py otp_test --phone "+1234567890"
```

## 🧪 Testing & Monitoring

```bash
# 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 admin@test.com

# Test Telegram
cli test-telegram --message "Hello!"
```

## 🔄 Background Tasks (Django-RQ)

```bash
# 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

```bash
# 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

```bash
# 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

```bash
# 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

```bash
# 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

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

## 🖥️ Streamlit Admin

```bash
# 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

```bash
# Generate FastAPI/SQLModel code from Django models
python manage.py generate_fastapi

# Generate standalone API client
python manage.py generate_client
```

## 📊 LLM & Monitoring

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

# Clean old monitor events
python manage.py monitor_cleanup
```

## 🤖 Telegram

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

## 🔑 Auth / OTP

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

## 🌍 Geo

```bash
# Populate geo/timezone data
python manage.py geo_populate
```

## ⏰ Cron Jobs

Commonly used commands in cron:

```bash
# 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:

```bash
# 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

| 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** | 9 | Django-RQ workers, scheduler, stats |
| **Development** | 8 | Server, ngrok, scripts, testing |
| **gRPC** | 4 | gRPC server, proto compilation |
| **Cloudflare D1** | 5 | D1 status, sync, logs, schemas |
| **Centrifugo** | 3 | WebSocket clients, publishing |
| **Streamlit** | 3 | Admin panel scaffolding, server |
| **Code Generation** | 2 | FastAPI, API client generation |
| **LLM & Monitoring** | 2 | API balance, event cleanup |
| **Telegram** | 1 | Bot polling mode |
| **Auth / OTP** | 1 | Throttle reset |
| **Geo** | 1 | Timezone/geo data |

## 💡 Tips

### Use Poetry for Project Commands

```bash
# Recommended
poetry run cli runserver

# Also works
python manage.py runserver
```

### Always Check Before Deploy

```bash
python manage.py check_settings --verbose
```

### Use Dry Run for Safety

```bash
python manage.py migrate_all --dry-run
```

### Test Integrations After Configuration

```bash
poetry run cli test-email --to admin@test.com
poetry run cli test-telegram --message "Deploy successful"
```

## 🔍 Find More Information

- **[Core Commands](./core-commands)** - Project setup, configuration
- **[Background Tasks](/docs/features/modules/django-rq/overview)** - Django-RQ commands
- **[Development](./development)** - Development tools
- **[Commands Overview](./overview)** - Full categorized list of all 50+ commands

---

**Quick, focused, practical.** Bookmark this page! 🚀
