This is a real-time chat application built using Django and Django Channels. It supports user authentication, real-time messaging, and a simple user interface for chatting.
- Django: Backend framework for handling user authentication and database management.
- Django Channels: For handling WebSocket connections to enable real-time communication.
- SQLite: Database for storing user and chat data.
- HTML/CSS/JavaScript: Frontend technologies for the user interface.
- User registration, login, and logout
- Real-time messaging using WebSockets
- Error handling for user registration (e.g., username conflicts, password mismatches)
-
Clone the repository:
git clone https://github.com/Piyush-sri11/Chat-app.git cd Chat-app
-
Create a virtual environment and activate it:
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install the required packages:
sh pip install -r requirements.txt
-
Apply database migrations:
python manage.py migrate
-
Run the development server:
python manage.py runserver
-
Open your browser and navigate to:
http://127.0.0.1:8000/
- Register: Create a new user account.
- Login: Log in with your credentials.
- Chat: Start chatting in real-time with other users.
server/models.py
: Contains theCustomUser
andChatModel
for user and chat data.server/views.py
: Handles user login, registration, and chat page rendering.server/routing.py
: WebSocket routing configuration.chat/asgi.py
: Integration with Django's ASGI application.server/templates
: HTML templates for the chat interface.server/migrations
: Database migration files.
Contributions are welcome! Please fork the repository and submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.