This project demonstrates how to implement WebSocket authentication in Django using Django Channels and Django Rest Framework with JWT.
WebSocket authentication is crucial for real-time communication applications to ensure secure access to WebSocket connections. This project provides a comprehensive guide on setting up authentication for WebSocket connections in Django, including project setup, model creation, Django Channels configuration, custom middleware implementation for authentication, and testing to ensure functionality.
- Secure WebSocket authentication using Django Channels and Django Rest Framework with JWT.
- Project setup guide with step-by-step instructions.
- Model creation for handling user authentication and chat functionalities.
- Configuration of Django Channels for WebSocket communication.
- Implementation of custom middleware for WebSocket authentication.
-
Clone the repository:
git clone https://github.com/JoseMiracle/AUTH_OVER_WEBSOCKET.git
-
Create and activate virtual environment
virtual env env\Scripts\activate : on Windows source env/bin/activate : on Linux/Mac
-
Install dependencies:
pip install -r requirements.txt
-
Run migrations:
python manage.py migrate
-
Start the development server:
python manage.py runserver
-
Access the application at
http://localhost:8000
.
Follow the detailed instructions provided in the documentation to set up WebSocket authentication in your Django project.
Contributions are welcome! Please refer to the contribution guidelines for more details.
This project is licensed under the MIT License - see the LICENSE file for details.