This is a real-time chat application built using Django and Channels, allowing users to join rooms and chat with others instantly. The project focuses on practicing websockets in Django and does not handle user authentication; instead, it stores rooms and messages.
- Clone this repository to your local machine:
git clone https://github.com/xSarscov/django-chat-app.git
- Change your current directory to the cloned repository:
cd django-chat-app
- Activate your virtual environment using Pipenv:
pipenv shell
- Install the required dependencies:
pipenv install
- Apply database migrations:
python manage.py migrate
- Run the Django development server:
python manage.py runserver
- Open your web browser and visit http://localhost:8000 to use the chat application.
- Upon visiting the application, users can create a new room by providing their username and the room name, or they can choose to join an existing room.
- The application does not validate user existence but ensures that room names are unique when creating a new room.
- Once in the chat page, users can see all existing rooms and join them to chat with other users in real-time.
core/
: Contains Django app files for managing rooms and messages.templates/
: Contains HTML templates for the user interface.static/
: Contains static files such as CSS and JavaScript for frontend functionality.Pipfile
andPipfile.lock
: Manage project dependencies using Pipenv.requirements.txt
: Alternative file for managing dependencies, useful for other virtual environments.
- Websockets are implemented using Django Channels for real-time communication.
- The application does not handle user authentication; it focuses solely on the chat functionality.
- Ensure that the required dependencies are installed and the virtual environment is activated before running the application.