Skip to Content
DocumentationFeaturesIntegrationsOverview

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

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)
  • Payment processing (Payment System)
  • Document processing (AI Knowledge Base)
  • Bulk operations (Newsletter campaigns, data imports)
  • Scheduled tasks (cleanup jobs, report generation)

Full Django-RQ Guide →

🔧 Development Tools

Ngrok Integration

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:

Full Ngrok Guide →

🔐 Authentication

Authentication Patterns

Enterprise authentication integration:

Core Features:

  • JWT authentication with djangorestframework-simplejwt
  • OAuth2/OIDC integration patterns
  • Multi-factor authentication with OTP (User Management)
  • Social auth with django-allauth patterns
  • API key authentication for machine-to-machine

Use Cases:

  • REST API authentication
  • SSO with OAuth2/OIDC providers
  • Multi-factor authentication
  • API key management

Full Auth Guide →

📱 Communication

Twilio Integration

SMS and voice communication integration:

Core Features:

  • SMS messaging with Twilio API
  • Voice calls and IVR integration
  • Number verification via SMS
  • Webhook handling for delivery status
  • Type-safe configuration with Pydantic

Alternatives:

Use Cases:

  • SMS notifications and alerts
  • Two-factor authentication
  • Voice calls and IVR systems
  • Phone number verification

Full Twilio Guide →

📐 Best Practices

Integration 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 →


Quick Start

Enable Django-RQ for Background Tasks

# 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, queues=[ RQQueueConfig(queue="default"), ], )
# 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 →

Enable Ngrok for Webhook Testing

# config.dev.yaml ngrok: enabled: true subdomain: "myapp" # myapp.ngrok.io auth_token: "${NGROK_AUTH_TOKEN}"
# Start server with ngrok tunnel python manage.py runserver_ngrok

Full Ngrok Guide →


Integration Architecture

Type-Safe Configuration

All integrations use Pydantic v2 for validation:

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, 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:

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

IntegrationTypeProduction ReadyAuto-ConfigCLI Tools
Django-RQTask Queue✅ Yes✅ Yesrqworker, rqscheduler, rqstats
NgrokDevelopment Tool⚠️ Dev Only✅ Yesrunserver_ngrok
AuthSecurity✅ Yes✅ Yestest_auth
TwilioCommunication✅ Yes✅ Yestest_sms

Configuration Best Practices

1. Use Environment Variables for Secrets

# config.prod.yaml ngrok: auth_token: "${NGROK_AUTH_TOKEN}" # From environment twilio: account_sid: "${TWILIO_ACCOUNT_SID}" auth_token: "${TWILIO_AUTH_TOKEN}"

2. Disable in Production When Not Needed

class ProductionConfig(DjangoConfig): # Ngrok only for development ngrok: None = None # Django-RQ for production background tasks django_rq: DjangoRQConfig = DjangoRQConfig( enabled=True, queues=[ RQQueueConfig(queue="high"), RQQueueConfig(queue="default"), RQQueueConfig(queue="low"), ], )

3. Test Integrations Before Production

# Test Django-RQ workers python manage.py rqworker default # Check queue stats python manage.py rqstats # Test Twilio SMS python manage.py test_sms +1234567890 # Test ngrok tunnel (dev only) python manage.py runserver_ngrok --test

See Also

Core Integrations

Background Processing:

Development Tools:

Authentication:

Communication:

Configuration & Setup

Getting Started:

Infrastructure:

Apps Using Integrations:

Other Modules:

Tools & Guides

CLI Commands:

Guides:


Next Steps

New to Integrations?

  1. Start with Django-RQ Overview for background tasks
  2. Try Ngrok Overview for webhook testing
  3. Review Integration Patterns for best practices

Ready for Production?

  1. Review Production Config
  2. Set up Redis for Django-RQ
  3. Configure environment variables for secrets
  4. Deploy workers using Django-RQ Monitoring guide

Need Help?


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