---
title: Integrations Overview
description: Django-CFG integrations overview. Production-ready third-party integrations with built-in validation, type safety, and seamless Django integration.
sidebar_label: Overview
sidebar_position: 0
keywords:
  - django-cfg integrations
  - django third-party integrations
  - django-rq integration
  - background tasks
  - redis queue
  - ngrok integration
---


# Integrations Overview

Django-CFG provides seamless integrations with essential third-party services and tools, making it easy to add powerful features to your Django application with minimal configuration.

## Available Integrations

### 🔄 Background Tasks

### [Django-RQ Integration](./django-rq/overview)

Production-ready Redis-based task queue with built-in monitoring:

**Core Features:**
- ✅ **High performance** - 10,000+ jobs/second with low memory usage
- ✅ **Redis-backed** queue with automatic job persistence
- ✅ **Type-safe** configuration with Pydantic validation
- ✅ **Worker management** via CLI commands (rqworker, rqscheduler)
- ✅ **Cron scheduling** with RQ Scheduler for periodic tasks
- ✅ **Built-in monitoring** - Django Admin, REST API, Prometheus metrics
- ✅ **Job dependencies** and retry logic with exponential backoff

**Use Cases:**
- Email sending and notifications ([Email Module](../modules/email/overview))
- Document processing ([AI Knowledge Base](../built-in-apps/ai-knowledge/overview))
- Bulk operations (Newsletter campaigns, data imports)
- Scheduled tasks (cleanup jobs, report generation)

[**Full Django-RQ Guide →**](./django-rq/overview)

### 🔧 Development Tools

### [Ngrok Integration](./ngrok/overview)

Secure tunnels for webhook testing in development:

**Core Features:**
- ✅ **Automatic tunnel** creation with custom subdomains
- ✅ **HTTPS support** for secure webhook delivery
- ✅ **Custom domains** with ngrok auth token
- ✅ **Auto-configuration** of ALLOWED_HOSTS and CSRF settings
- ✅ **CLI integration** with `runserver_ngrok` command

**Use Cases:**
- OAuth callback testing ([Authentication](./auth))
- Third-party API webhooks
- Mobile app development

[**Full Ngrok Guide →**](./ngrok/overview)

### 🔐 Authentication

### [Authentication Patterns](./auth)

Enterprise authentication integration:

**Core Features:**
- ✅ **JWT authentication** with djangorestframework-simplejwt
- ✅ **Two-Factor Authentication (2FA)** with TOTP (RFC 6238) for authenticator apps
- ✅ **OAuth2/OIDC** integration patterns (GitHub OAuth built-in)
- ✅ **OTP Login** passwordless email-based login
- ✅ **Backup codes** for 2FA recovery
- ✅ **API key** authentication for machine-to-machine

**Use Cases:**
- REST API authentication with JWT tokens
- Two-factor authentication for high-security apps
- Passwordless login with email OTP
- OAuth2 with GitHub and other providers

[**Full Auth Guide →**](./auth)

### 📐 Best Practices

### [Integration Patterns](./patterns)

Common patterns and best practices:

**Core Patterns:**
- ✅ **Webhook handling** patterns and security
- ✅ **API client** configuration and error handling
- ✅ **Rate limiting** and retry strategies
- ✅ **Secret management** with environment variables
- ✅ **Testing strategies** for third-party integrations

**Use Cases:**
- Building robust webhook handlers
- Implementing API rate limiting
- Managing third-party secrets
- Testing external integrations

[**Full Patterns Guide →**](./patterns)


---

## Quick Start

### Enable Django-RQ for Background Tasks

```python
# api/config.py
from django_cfg import DjangoConfig
from django_cfg.models import DjangoRQConfig, RQQueueConfig

class MyConfig(DjangoConfig):
    redis_url: str = "redis://localhost:6379/0"

    django_rq: DjangoRQConfig = DjangoRQConfig(
        enabled=True,
        redis_db=0,  # Required: unique per project (0-15)
        queues=[
            RQQueueConfig(queue="default"),
        ],
    )
```

```python
# apps/myapp/tasks.py
def send_welcome_email(user_id: int):
    """Task runs in background worker."""
    # Task code here
    pass

# Enqueue from anywhere
import django_rq
queue = django_rq.get_queue('default')
queue.enqueue('apps.myapp.tasks.send_welcome_email', user_id=123)
```

[**Full Django-RQ Guide →**](./django-rq/overview)

### Enable Ngrok for Webhook Testing

```yaml
# config.dev.yaml
ngrok:
  enabled: true
  subdomain: "myapp"  # myapp.ngrok.io
  auth_token: "${NGROK_AUTH_TOKEN}"
```

```bash
# Start server with ngrok tunnel
python manage.py runserver_ngrok
```

[**Full Ngrok Guide →**](./ngrok/overview)

---

## Integration Architecture

### Type-Safe Configuration

All integrations use [Pydantic v2](/docs/fundamentals/core/type-safety) for validation:

```python
from django_cfg import DjangoConfig
from django_cfg.models import DjangoRQConfig, RQQueueConfig, NgrokConfig

class MyConfig(DjangoConfig):
    redis_url: str = "redis://localhost:6379/0"

    # Django-RQ configuration
    django_rq: DjangoRQConfig = DjangoRQConfig(
        enabled=True,
        redis_db=0,  # Required: unique per project (0-15)
        queues=[
            RQQueueConfig(queue="default"),
            RQQueueConfig(queue="high"),
        ],
    )

    # Ngrok configuration
    ngrok: NgrokConfig | None = NgrokConfig(
        enabled=True,
        subdomain="myapp"
    )
```

### Environment-Based Enablement

Enable integrations per environment using [environment detection](/docs/fundamentals/configuration/environment):

```python
class MyConfig(DjangoConfig):
    @property
    def ngrok(self) -> NgrokConfig | None:
        # Only enable ngrok in development
        if self.is_development:
            return NgrokConfig(enabled=True)
        return None
```

### Automatic Django Integration

Integrations automatically configure Django settings:

- **Django-RQ**: Configures RQ_QUEUES, Redis connections, worker management
- **Ngrok**: Updates ALLOWED_HOSTS, CSRF_TRUSTED_ORIGINS, generates public URL
- **Auth**: Configures authentication backends, middleware, JWT settings

---

## Integration Comparison

| Integration | Type | Production Ready | Auto-Config | CLI Tools |
|-------------|------|------------------|-------------|-----------|
| **Django-RQ** | Task Queue | ✅ Yes | ✅ Yes | ✅ `rqworker`, `rqscheduler`, `rqstats` |
| **Ngrok** | Development Tool | ⚠️ Dev Only | ✅ Yes | ✅ `runserver_ngrok` |
| **JWT Auth** | Security | ✅ Yes | ✅ Yes | - |
| **2FA/TOTP** | Security | ✅ Yes | ✅ Yes | - |
| **OTP Login** | Security | ✅ Yes | ✅ Yes | - |

---

## Configuration Best Practices

### 1. Use Environment Variables for Secrets

```yaml
# config.prod.yaml
ngrok:
  auth_token: "${NGROK_AUTH_TOKEN}"  # From environment

```

### 2. Disable in Production When Not Needed

```python
class ProductionConfig(DjangoConfig):
    # Ngrok only for development
    ngrok: None = None

    # Django-RQ for production background tasks
    django_rq: DjangoRQConfig = DjangoRQConfig(
        enabled=True,
        redis_db=0,  # Required: unique per project (0-15)
        queues=[
            RQQueueConfig(queue="high"),
            RQQueueConfig(queue="default"),
            RQQueueConfig(queue="low"),
        ],
    )
```

### 3. Test Integrations Before Production

```bash
# Test Django-RQ workers
python manage.py rqworker default

# Check queue stats
python manage.py rqstats

# Test ngrok tunnel (dev only)
python manage.py runserver_ngrok --test
```

---

## See Also

### Core Integrations

**Background Processing:**
- **[Django-RQ Overview](./django-rq/overview)** - Complete task queue guide
- **[Django-RQ Architecture](./django-rq/architecture)** - System design and components
- **[Django-RQ Configuration](./django-rq/configuration)** - Setup and configuration
- **[Django-RQ Examples](./django-rq/examples)** - Real-world task patterns
- **[Django-RQ Monitoring](./django-rq/monitoring)** - Task monitoring and observability

**Development Tools:**
- **[Ngrok Overview](./ngrok/overview)** - Webhook testing guide
- **[Ngrok Configuration](./ngrok/configuration)** - Tunnel configuration

**Authentication:**
- **[Auth Patterns](./auth)** - Enterprise authentication
- **[User Management](../built-in-apps/user-management/accounts)** - Built-in user system

**Communication:**
- **[Telegram Module](../modules/telegram/overview)** - Bot notifications
- **[Email Module](../modules/email/overview)** - Email sending

### Configuration & Setup

**Getting Started:**
- **[Configuration Guide](/docs/getting-started/configuration)** - Enable integrations
- **[Configuration Models](/docs/fundamentals/configuration)** - Integration config API
- **[Environment Detection](/docs/fundamentals/configuration/environment)** - Environment-specific integrations

**Infrastructure:**
- **[Redis Configuration](/docs/fundamentals/configuration/cache)** - Redis setup for Django-RQ
- **[Security Settings](/docs/fundamentals/configuration/security)** - Webhook signature verification
- **[Environment Variables](/docs/fundamentals/configuration/environment)** - Manage API keys securely

### Related Features

**Apps Using Integrations:**
- **[AI Knowledge Base](../built-in-apps/ai-knowledge/overview)** - Uses Django-RQ for document processing
- **[Newsletter](../built-in-apps/user-management/newsletter)** - Uses Django-RQ for bulk emails

**Other Modules:**
- **[Modules Overview](../modules/overview)** - All available modules
- **[LLM Module](../modules/llm/overview)** - AI model integration

### Tools & Guides

**CLI Commands:**
- **[CLI Introduction](/docs/cli/introduction)** - All CLI tools

**Guides:**
- **[Integration Patterns](./patterns)** - Best practices
- **[Production Config](/docs/guides/production-config)** - Production integration setup
- **[Troubleshooting](/docs/guides/troubleshooting)** - Common integration issues

---

## Next Steps

**New to Integrations?**
1. Start with [Django-RQ Overview](./django-rq/overview) for background tasks
2. Try [Ngrok Overview](./ngrok/overview) for webhook testing
3. Review [Integration Patterns](./patterns) for best practices

**Ready for Production?**
1. Review [Production Config](/docs/guides/production-config)
2. Set up [Redis](/docs/fundamentals/configuration/cache) for Django-RQ
3. Configure [environment variables](/docs/fundamentals/configuration/environment) for secrets
4. Deploy workers using [Django-RQ Monitoring](./django-rq/monitoring) guide

**Need Help?**
- [Troubleshooting Guide](/docs/guides/troubleshooting)
- [FAQ](/docs/guides/faq)
- [CLI Commands](/docs/cli/introduction)

---

Django-CFG integrations: **Production-ready, type-safe, zero-config.** 🚀
