Skip to Content
FeaturesIntegrationsOverview

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, rqcron)
  • ✅ Cron scheduling on RQ’s native cron (rqcron) 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)
  • Document processing
  • Bulk operations (Newsletter campaigns, data imports)
  • Scheduled tasks (cleanup jobs, report generation)

Full Django-RQ Guide →

🔐 Authentication

Authentication Patterns

Enterprise authentication integration:

Core Features:

  • ✅ JWT authentication with djangorestframework-simplejwt
  • ✅ Two-Factor Authentication (2FA) with TOTP (RFC 6238) for authenticator apps
  • ✅ Google and GitHub sign-in built in (client id + secret, PKCE, one verified email = one user)
  • ✅ 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
  • Social sign-in with Google and GitHub

Full Auth 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 →


CMDOP

Connect supported AI clients to an authorized development machine and work on your Django-CFG repository through MCP or the SDK. This is a separate machine integration, not the application-level django_mcp module.

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, redis_db=0, # Required: unique per project (0-15) 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 →


Integration Architecture

Type-Safe Configuration

All integrations use Pydantic v2 for validation:

from django_cfg import DjangoConfig from django_cfg.models import DjangoRQConfig, RQQueueConfig 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"), ], )

Environment-Based Enablement

Enable integrations per environment using environment detection:

class MyConfig(DjangoConfig): @property def django_rq(self) -> DjangoRQConfig | None: # Only run background workers outside of development if self.is_development: return None return DjangoRQConfig(enabled=True, redis_db=0)

Automatic Django Integration

Integrations automatically configure Django settings:

  • Django-RQ: Configures RQ_QUEUES, Redis connections, worker management
  • Auth: Configures authentication backends, middleware, JWT settings

Integration Comparison

IntegrationTypeProduction ReadyAuto-ConfigCLI Tools
Django-RQTask Queue✅ Yes✅ Yes✅ rqworker, rqcron, rqstats
JWT AuthSecurity✅ Yes✅ Yes-
2FA/TOTPSecurity✅ Yes✅ Yes-
OTP LoginSecurity✅ Yes✅ Yes-

Configuration Best Practices

1. Use Environment Variables for Secrets

# config.prod.yaml telegram: bot_token: "${TELEGRAM_BOT_TOKEN}" # From environment

2. Enable Only What Each Environment Needs

class ProductionConfig(DjangoConfig): # 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

# Test Django-RQ workers python manage.py rqworker default # Check queue stats python manage.py rqstats

See Also

Core Integrations

Background Processing:

Authentication:

Communication:

Configuration & Setup

Getting Started:

Infrastructure:

Other Modules:

Tools & Guides

CLI Commands:

Guides:


Next Steps

New to Integrations?

  1. Start with Django-RQ Overview for background tasks
  2. 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. 🚀

Last updated on