💬 django-supchat
Real-time support chat for Django: visitor widget, operator workspace, AI auto-replies
Zero runtime dependencies. No Redis, no WebSockets required, no build step.
Django, vanilla JS and Server-Sent Events.
Quick start · Features · Documentation · راهنمای فارسی
🖼️ Preview
| Operator panel | Widget |
|---|---|
| Persian, dark, right-to-left | Widget in Persian, dark |
Analytics and mobile
✨ Features
For visitors (the widget)
- Real-time chat over SSE with typing indicators, read receipts (✓ / ✓✓) and an unread badge
- Replies, emoji reactions, emoji picker, image and file attachments (paste or pick), image lightbox
- Welcome message, quick-reply chips and an optional pre-chat form (name / email)
- End chat, 1–5 star rating with a comment, transcript download or email
- 8 languages (EN, FA, AR, TR, ES, DE, FR, RU) with a fixed language button and automatic RTL
- Light / dark / auto themes, an accent color and CSS variables
- Message sounds, synthesized with WebAudio (no audio files) and with a mute toggle
- Skeleton loading, full screen on phones, keyboard and screen-reader friendly, honours
prefers-reduced-motion
For operators (/supchat/operator/)
- A calm five-pane workspace (rail, inbox, conversations, chat, details) with live updates
- Filters (all, unassigned, mine, unread, closed) and full-text search
- Assignment, priority, subject and colored tags
- Private internal notes that visitors never receive
- Quick replies: type
/shortcutin the composer - Attachments, replies, reactions, copy, and the visitor's typing state
- Close, reopen, block visitor, delete, and transcript download or email
- Analytics: conversations, messages, busiest hours, ratings, first-response time, top tags
- English/Persian (and 6 more) with a fixed language button, plus light/dark theme
- Desktop notifications, sound and keyboard shortcuts (
Ctrl/⌘ K,Alt ↑/↓,Esc)
AI and integrations
- AI auto-replies from ChatGPT/OpenAI, Anthropic, or any OpenAI-compatible API (Groq, OpenRouter, Mistral, DeepSeek, Ollama, LM Studio, Azure…), or your own Python function
- Human handoff: the bot stops as soon as an operator replies or the visitor asks for a person
- Webhooks for Slack, Discord, or generic JSON signed with HMAC-SHA256
- REST + SSE API with header-token auth for mobile and native clients
- Optional WebSocket transport via Django Channels
Security
- CSRF on every cookie-authenticated POST
- Signed HttpOnly guest identity
- Access checks on every endpoint and stream
- Audience-scoped events, so notes never leak to visitors
- HTML stripping, a blocked-word list and rate limits
- Upload checks: an extension allowlist plus magic-byte sniffing, and SVG/HTML are always refused
- Attachments are served with
nosniffand a sandbox CSP - Webhook SSRF guard, visitor blocking by guest or hashed IP, and a retention clean-up command
🚀 Quick start
pip install django-supchat
# settings.py
INSTALLED_APPS = [
# ...
"supchat",
]
SUPCHAT = {
"TITLE": "Acme Support",
"WELCOME_MESSAGE": "Hi! How can we help?",
}
# urls.py
from django.urls import include, path
urlpatterns = [
# ...
path("supchat/", include("supchat.urls")),
]
python manage.py migrate
{% load supchat %}
<!-- anywhere in your base template, usually right before </body> -->
{% supchat %}
Staff users open the operator panel at /supchat/operator/. That's it. 🎉
Want AI replies? Add
"AI": {"ENABLED": True, "PROVIDER": "openai", "API_KEY": env("OPENAI_API_KEY"), "MODEL": "<model id>"}. See docs/ai.md.
📚 Documentation
| Guide | What's inside |
|---|---|
| Installation | Requirements, setup, media files, upgrading from 1.x |
| Configuration | Every SUPCHAT setting with defaults |
| Widget | Template tag options, theming, CSS variables, JS API and events |
| Operator panel | Inbox, notes, quick replies, tags, analytics, shortcuts |
| AI auto-replies | OpenAI/ChatGPT, Anthropic, OpenAI-compatible hosts, custom functions, handoff |
| Webhooks | Slack, Discord, signed JSON and signature verification |
| REST & mobile API | Endpoints, SSE events, header-token auth for native apps |
| Realtime & deployment | SSE, proxies, multiple workers, the WebSocket adapter |
| Security | Threat model and every protection in place |
| Languages | Built-in languages, RTL, adding your own |
| Python API & signals | Service functions, signals, management command |
| Development | Running tests, the demo project, contributing |
| راهنمای فارسی | خلاصهی نصب و امکانات به فارسی |
🗺️ Roadmap
- File and image attachments
- Message reactions and emoji
- Conversation tags and priority
- Canned responses / quick replies
- Chat transcripts by email and download
- Webhook integrations (Slack, Discord, signed JSON)
- AI auto-responses (OpenAI-compatible, Anthropic, custom)
- Multi-language support beyond EN/FA (8 languages)
- REST/SSE API with token auth for mobile clients
- Optional WebSocket adapter (Django Channels)
- Native iOS / Android SDK packages (the API is ready; see docs/api.md)
- Business hours and offline forms
- Message search inside a conversation
🤝 Contributing
git clone https://github.com/xo-aria/django-supchat.git
cd django-supchat
pip install -e ".[test]"
pytest --cov=supchat
See docs/development.md for the demo project and guidelines.
📄 License & Trademark
django-supchat is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0). You may use, modify and distribute it, commercially too. If you distribute it or run a modified version as a network service, you must publish your source under the same license and state your changes. 📖 Full license
The name "SupChat" is a trademark of xo-aria. See the Trademark Policy. When you distribute it, keep the attribution:
Based on SupChat by xo-aria
https://github.com/xo-aria/django-supchat
Licensed under AGPL-3.0
Need a commercial license without the AGPL terms? Open an issue or contact us.
If django-supchat helps your project, please ⭐ the repository.
Issues · Discussions · Made with ❤️ by xo-aria
Metadata
Release files for django-supchat 2.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| django_supchat-2.0.0.tar.gz | 137.9 kB | Without provenance | Details for django_supchat-2.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| django_supchat-2.0.0-py3-none-any.whl | Python 3 | none | any | Details for django_supchat-2.0.0-py3-none-any.whl |
Total release size: 261.8 kB
Release files / django_supchat-2.0.0.tar.gz
| Download URL | django_supchat-2.0.0.tar.gz |
|---|---|
| Size | 137.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
25efe8e0f9dbecfe91e620a0c78893291054c0697b018b2653467479a9f77918
|
|
BLAKE2b-256 checksum How to use checksums |
ad5fd4f39e6141be4c65b8e669f5f4422493f69b9a3bf5ade97848858cf84275
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / django_supchat-2.0.0-py3-none-any.whl
| Download URL | django_supchat-2.0.0-py3-none-any.whl |
|---|---|
| Size | 123.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
06026bbdf05c808649c16a785804fef0878c16a73d926caa63eb1e4d746f4995
|
|
BLAKE2b-256 checksum How to use checksums |
90a6ef9fcdf65218547653dbcb82d46203de0fa746508bde070967f69fb78553
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Security for django-supchat 2.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.