This is a real-time chat application project based on Django, Redis, and Django Channels. It allows users to communicate with each other in real time using websockets. In this guide, you'll find instructions on how to set up and run the project.
Before you begin, make sure you have the following installed on your system:
- Python (version 3.6 or higher)
- Redis
-
Install Redis:
-
Download Redis from the official website or use the link provided in the project. For example, you can download Redis for Windows here.
-
Install Redis by running the downloaded installer.
-
After installation, open the Redis CLI (Command-Line Interface) as shown in the screenshot below:
-
-
Clone the project repository:
git clone https://github.com/Hack-Shark/TangiTalk cd TangiTalk-main
-
Install project dependencies:
pip install -r requirements.txt
-
Migrate the database and create a superuser:
python manage.py migrate python manage.py createsuperuser
To run the chat application, follow these steps:
-
Start the Redis server:
-
Open a new terminal or command prompt window.
-
Navigate to the Redis installation directory (where Redis is installed).
-
Run the following command to start the Redis server:
redis-server
-
-
Run the Django development server:
python manage.py runserver
-
Open a web browser and visit
http://localhost:8000
to access the chat application.
Once the chat application is running, you can perform the following actions:
- Register a new user account or log in with an existing account.
- Send and receive real-time messages in the chat rooms.
- View a list of registered users.
- Send private messages to other users.
- Set your profile picture and personalized description.
Here is a brief overview of the project structure:
chat
- The main Django application containing the chat-related functionality.static
- Static files for the project, including JavaScript, CSS, and images.templates
- HTML templates for rendering the web pages.chat/views.py
- Views (controllers) for handling different requests and rendering templates.chat/models.py
- Models representing the database structure.chat/urls.py
- URL patterns for routing requests to appropriate views.chat/consumers.py
- WebSocket consumers for handling real-time chat functionality using Django Channels.
Here are some additional improvements you can consider for the chat application:
- Add functionality to upload and share files in the chat rooms.
- Implement message history and display the chat history when joining a room.
- Enhance the user interface and styling of the chat application.
- Implement notifications for new messages or user activities.
- Add support for emojis or other rich text formatting in the messages.
Feel free to customize and extend the project according to your requirements and preferences.
Enjoy building your real-time chat application with Django and Django Channels!