A real-time chat application built with Django and Django Channels, featuring WebSocket communication for instant messaging.
- Real-time messaging using WebSocket
- Multiple chat rooms
- User-friendly interface
- Mobile-responsive design
- Automatic reconnection handling
- Real-time typing indicators
- Message timestamps
Users can enter their name and choose a chat room
The main chat interface where users can send and receive messages
Multiple users chatting in real-time
- Python 3.13
- Django 5.1.3
- Django Channels 4.1.0
- WebSocket
- HTML/CSS/JavaScript
- Bootstrap 5
- SQLite
- Clone the repository
git clone https://github.com/Is-haka/django_chat.git
cd django_chat- Create a virtual environment and activate it
python -m venv venv
source venv/bin/activate # On Windows use: venv\Scripts\activate- Install dependencies
pip install -r requirements.txt- Run migrations
python manage.py migrate- Start the development server
python manage.py runserver- Visit http://localhost:8000 in your browser
- Open the application in your web browser
- Enter your desired username and room name
- Start chatting!
- Open another browser window and join the same room with a different username to test real-time chat
django_v1/
├── chat/ # Main chat application
│ ├── consumers.py # WebSocket consumer
│ ├── routing.py # WebSocket routing
│ ├── urls.py # URL configurations
│ └── views.py # View functions
├── config/ # Project configuration
│ ├── asgi.py # ASGI configuration
│ ├── settings.py # Project settings
│ ├── urls.py # Main URL routing
│ └── wsgi.py # WSGI configuration
└── templates/ # HTML templates
├── base.html # Base template
├── index.html # Login page
└── room.html # Chat room page
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request