Production-ready Django WhatsApp Cloud Platform — Inbox, Campaigns, Templates, Analytics
Project description
django-meta-whatsapp is not just an API wrapper — it's a fully-featured, drop-in WhatsApp CRM and messaging platform that lives entirely within your existing Django project. Beautiful Tailwind UI, real-time inbox, bulk campaigns, webhook engine, and REST APIs — all without third-party SaaS subscriptions.
✨ Features
- 📨 Live Unified Inbox — Real-time chat interface with media, reply threading, and message status ticks.
- 🚀 Marketing Campaigns — Schedule and send bulk messages using approved WhatsApp Templates. Track delivery, read rates, and bounce rates.
- 👥 Contact Management — Import CSVs, assign dynamic colored Labels, and auto-sync users who subscribe via WhatsApp deep-links.
- 🎯 Contact Filter Presets — Define named audience filters in settings for one-click campaign targeting.
- 🔗 User Model Integration — Link your Django
Usermodel toWhatsAppContactwith pluggable audience providers. - 🚫 Blocked User Sync — Automatically detect and exclude users who block your business.
- 🧩 Template Sync — Pull all approved WhatsApp message templates directly from Meta with one click.
- 🔗 In-App Signups — Create and manage
wa.medeep links so users can instantly opt-in. - ⚡ Webhooks Engine — Built-in webhook endpoints to automatically ingest incoming messages, delivery receipts, and status updates.
- 🔑 REST APIs — Send text, location, template; list chats/campaigns (API-key auth).
- 🏢 Multi-Account — One Django project, multiple WhatsApp Business Accounts.
📦 Installation
# Using uv (Recommended)
uv add django-meta-whatsapp
# Using pip
pip install django-meta-whatsapp
⚙️ Configuration
1. Add to INSTALLED_APPS:
INSTALLED_APPS = [
# ...
"django_meta_whatsapp",
]
2. Mount URLs in urls.py:
from django.urls import path, include
urlpatterns = [
# ...
path("whatsapp/", include("django_meta_whatsapp.urls", namespace="django_meta_whatsapp")),
]
3. Add WHATSAPP settings to settings.py:
WHATSAPP = {
# ── Required ──────────────────────────────────────────
"API_TOKEN": "EAA...",
"PHONE_NUMBER_ID": "1234567890",
"WEBHOOK_VERIFY_TOKEN": "your_secure_random_string",
# ── UI Customization (optional) ───────────────────────
"DASHBOARD_NAME": "My Business CRM",
"DASHBOARD_LOGO": "https://yourwebsite.com/logo.png",
# ── Audience Providers (optional) ─────────────────────
# Map your own model querysets as named campaign audiences
"PHONE_FIELD": "phone", # field on your model with the phone number
"NAME_FIELD": "name", # field on your model with the display name
"AUDIENCES": {
"All Users": "myapp.audiences.all_users",
"VIP Customers": "myapp.audiences.vip_customers",
},
# ── Contact Filter Presets (optional) ─────────────────
# Pre-defined filters shown as a dropdown in the Campaign form
"CONTACT_FILTERS": {
"VIP Customers": '{"labels__name": "VIP"}',
"Subscribed via Link": '{"subscribed_via_signup__isnull": false}',
"New This Month": '{"created_at__gte": "2024-06-01"}',
},
}
4. Run migrations:
python manage.py migrate
🚀 Quickstart
- Visit
/whatsapp/in your browser. - The UI will prompt you to add a WhatsApp Account if none exists.
- Set your Meta App Webhook URL to
https://yourdomain.com/whatsapp/webhook/. - Sync your templates from the Templates tab.
- Start chatting from the Inbox!
🔗 Linking Your Django User Model
You can link WhatsAppContact to your existing User model without modifying the package. Three approaches are documented:
Option A — Profile Model (recommended):
from django_meta_whatsapp.models import WhatsAppContact
class UserWhatsAppProfile(models.Model):
user = models.OneToOneField(settings.AUTH_USER_MODEL, on_delete=models.CASCADE, related_name="whatsapp_profile")
contact = models.OneToOneField(WhatsAppContact, on_delete=models.SET_NULL, null=True, blank=True)
Option B — Query your User model directly as a campaign audience:
# myapp/audiences.py
from django.contrib.auth import get_user_model
User = get_user_model()
def all_users():
return User.objects.filter(is_active=True, phone__isnull=False)
See the full documentation for signals-based auto-linking and more filter patterns.
🔑 REST API
All endpoints require an X-API-Key header (generated from the dashboard under Settings → API Keys).
# Send a text message
curl -X POST https://yourdomain.com/whatsapp/api/send-message/ \
-H "X-API-Key: your-key" \
-H "Content-Type: application/json" \
-d '{"phone": "919876543210", "message": "Hello!"}'
# Send an approved template
curl -X POST https://yourdomain.com/whatsapp/api/send-template/ \
-H "X-API-Key: your-key" \
-H "Content-Type: application/json" \
-d '{"phone": "919876543210", "template_name": "order_update", "language": "en", "body_params": ["Rahul", "ORD-999"]}'
📖 Full Documentation
https://rahul-baberwal.github.io/django-meta-whatsapp
📋 Changelog
v1.0.4
- ✅ Updated README with complete settings reference and REST API examples
- ✅ Version badge added to docs (auto-updated each release)
- ✅ Django 4.0 / 5.0 / 5.1 + Python 3.9+ version tags corrected in docs & README
v1.0.3
- ✅ Contact Filter Presets — define named filters in settings, auto-populate campaign form
- ✅ User model linking docs — 3 integration patterns with code examples
- ✅ Dashboard logo updated to custom PNG
- ✅ Sidebar scrollbar hidden for premium feel
v1.0.2
- ✅ Single clean migration (
0001_initial.py) - ✅ Mintlify-style documentation site (
docs/index.html) - ✅ REST API documentation with cURL examples
- ✅
pyproject.toml+uvmigration
v1.0.1
- ✅ Label system with color picker (tom-select)
- ✅ Blocked user sync, In-App Signups, Catalog products
- ✅ WhatsApp Catalog product management
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file django_meta_whatsapp-1.0.4.tar.gz.
File metadata
- Download URL: django_meta_whatsapp-1.0.4.tar.gz
- Upload date:
- Size: 1.0 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e706dac5f20c73187f603fbee553c91c6de7662818bc65a27605a0256ceef043
|
|
| MD5 |
4cd0b067b22f33d907459961826df18c
|
|
| BLAKE2b-256 |
c2136b17f088ccabadbf52f90ff1e086d79266cda3b09b90d84179bae19b829a
|
Provenance
The following attestation bundles were made for django_meta_whatsapp-1.0.4.tar.gz:
Publisher:
publish.yml on rahul-baberwal/django-meta-whatsapp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
django_meta_whatsapp-1.0.4.tar.gz -
Subject digest:
e706dac5f20c73187f603fbee553c91c6de7662818bc65a27605a0256ceef043 - Sigstore transparency entry: 1815718755
- Sigstore integration time:
-
Permalink:
rahul-baberwal/django-meta-whatsapp@6c7ec45c0d445832e11a6d32c4bd58ee0a05b759 -
Branch / Tag:
refs/tags/v1.0.4 - Owner: https://github.com/rahul-baberwal
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@6c7ec45c0d445832e11a6d32c4bd58ee0a05b759 -
Trigger Event:
push
-
Statement type:
File details
Details for the file django_meta_whatsapp-1.0.4-py3-none-any.whl.
File metadata
- Download URL: django_meta_whatsapp-1.0.4-py3-none-any.whl
- Upload date:
- Size: 5.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
63e275a2b57ab88ee36a79c9e37c0bd395286496e7ae323618903ac5d59bad27
|
|
| MD5 |
929cb7db53552b0825753cc761628e51
|
|
| BLAKE2b-256 |
ab2861661621f91cd78505cd4694645de6d4a226c4566c969ce3a48efa4c76a2
|
Provenance
The following attestation bundles were made for django_meta_whatsapp-1.0.4-py3-none-any.whl:
Publisher:
publish.yml on rahul-baberwal/django-meta-whatsapp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
django_meta_whatsapp-1.0.4-py3-none-any.whl -
Subject digest:
63e275a2b57ab88ee36a79c9e37c0bd395286496e7ae323618903ac5d59bad27 - Sigstore transparency entry: 1815718974
- Sigstore integration time:
-
Permalink:
rahul-baberwal/django-meta-whatsapp@6c7ec45c0d445832e11a6d32c4bd58ee0a05b759 -
Branch / Tag:
refs/tags/v1.0.4 - Owner: https://github.com/rahul-baberwal
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@6c7ec45c0d445832e11a6d32c4bd58ee0a05b759 -
Trigger Event:
push
-
Statement type: