A real-time peer-to-peer video calling web application built using Django, Django Channels, WebRTC, and Redis.
Users can make and receive video calls, manage their call history, and enjoy a modern, responsive UI inspired by WhatsApp.
⚠️ Note: This project is designed for development and testing.
For production deployment, make sure to configure HTTPS, secure WebSockets, and a TURN server for reliable connectivity.
- 🔄 Real-time two-way video calling (WebRTC)
- 📡 WebSocket signaling via Django Channels
- 📞 Call state management:
RINGING,CONNECTED,MISSED,ENDED - 👥 Simple login & signup system
- 🕒 Call history with timestamps and duration
- 🎛️ In-call controls: mute, disable camera, end call
- ✨ Animated incoming call modal
- 📱 Responsive UI, inspired by WhatsApp
- ⚡ Redis-backed Channel Layer for real-time communication
| Technology | Version | Description |
|---|---|---|
| Django | 5.2 | Web framework |
| Django Channels | 4.0+ | WebSocket and async support |
| Redis | 6.0+ | Channel layer backend |
| WebRTC | Native | Real-time audio/video streaming |
| JavaScript | Vanilla | Frontend logic |
| HTML/CSS | Custom | UI design |
Before running the project, make sure you have:
- 🐍 Python 3.9+
- 📦 pip (Python package manager)
- 🔴 Redis Server (running locally or via Docker)
- 🌐 Git
You can install Redis via Docker easily:
docker run -d -p 6379:6379 redisClone the repository and set up the environment:
# Clone the project
git clone https://github.com/ReZaiden/Video-Call-with-Django.git
cd Video-Call-with-Django
# Create and activate virtual environment
python -m venv venv
source venv/bin/activate # On Linux/Mac
venv\Scripts\activate # On Windows
# Install dependencies
pip install -r requirements.txt
# Run database migrations
python manage.py migrate
# Start Redis (if not already running)
redis-server# Collect Static files
python manage.py collectstatic
# Push to database
python manage.py makemigrations
python manage.py migrate
# Create a superuser
python manage.py createsuperuser
# Start Django server
daphne -b 127.0.0.1 -p 8000 project.asgi:application
Then open your browser and go to:
http://127.0.0.1:8000- Sign in or create an account
- Enter a username to call another registered user
- The receiver sees an incoming call modal
- Both users are connected via WebRTC peer connection
- Media streams (audio/video) are exchanged P2P
- Signaling handled through Django Channels (WebSockets)
- Redis manages real-time message passing
## 🧩 Project Structure
```plaintext
├── project/
│ ├── asgi.py # ASGI entry point (for WebSockets)
│ ├── settings.py # Django + Channels configuration
│ └── urls.py # URL routing
│
├── VideoCall/
│ ├── consumers.py # WebSocket consumers for signaling
│ ├── routing.py # Channel routing setup
│ ├── models.py # Call and user models
│ ├── views.py # Authentication and view logic
│ ├── templates/ # HTML templates
│ ├── static/js/main.js # WebRTC and signaling logic
│ ├── static/js/login.js # JS of login page
│ ├── static/css/style.css # CSS of main page
│ └── static/css/login.css # CSS of login page
│
├── requirements.txt
└── manage.py
- Use HTTPS in production (WebRTC requires secure contexts)
- Add a TURN server for NAT traversal
- Configure proper CORS and CSRF settings
- Consider JWT authentication for scalable setups
- ✅ TURN/STUN server integration
- ✅ Typing & chat support during calls
- ✅ Push notifications for missed calls
- ✅ Dark & light theme toggle
- ✅ Docker Compose setup for deployment
Developed by: ReZaiden
💼 GitHub: @ReZaiden
📧 Contact: rezaidensalmani@gmail.com
This project is licensed under the MIT License.