A real-time chat application built using Django and Django Channels. This app allows users to send and receive messages in real-time, supporting user authentication, private and group chat features, and an intuitive user interface.
- Real-time Messaging: Send and receive messages instantly using WebSockets via Django Channels.
- User Authentication: Users can register, log in, and manage their accounts.
- Private Chats: Users can send direct messages to other users in a one-on-one chat.
- Group Chats: Users can create or join group chats for group discussions.
- Message History: View message history in both private and group chats.
- Notifications: Real-time notifications for new messages and activities.
- Backend: Django, Django Channels (for WebSocket support)
- Frontend: HTML, CSS (Bootstrap for responsive design)
- Database: PostgreSQL (or SQLite for development)
- WebSocket Protocol: Django Channels and Daphne for handling real-time communication
- Authentication: Django's built-in authentication system
Follow these steps to set up the project locally:
-
Clone the repository:
git https://github.com/Danitilahun/Django_chat_application.git
-
Create a virtual environment:
python -m venv venv
-
Activate the virtual environment:
-
On Windows:
venv\Scripts\activate
-
On macOS/Linux:
source venv/bin/activate
-
-
Install the dependencies:
pip install -r requirements.txt
-
Set up the database:
python manage.py migrate
-
Create a superuser (optional for admin access):
python manage.py createsuperuser
-
Run the development server:
python manage.py runserver
-
Access the application:
Visit
http://127.0.0.1:8000/in your browser to access the app.
- Authentication: You can register a new account or log in with an existing one.
- Private Chat: Once logged in, you can search for users and start a private chat.
- Message Sending: Type messages and send them in real-time to other users in the active chat room.
If you're using PostgreSQL for production, update the DATABASES configuration in settings.py with your PostgreSQL credentials. For development, the default SQLite database is used.
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'your_db_name',
'USER': 'your_db_user',
'PASSWORD': 'your_db_password',
'HOST': 'localhost',
'PORT': '5432',
}
}- Django for the powerful backend framework.
- Django Channels for WebSocket support.
- Bootstrap for the responsive frontend.
- The open-source community for tools and libraries.