This project demonstrates the implementation of user authentication using the Django Ninja framework and JSON Web Tokens (JWT). It provides a basic yet comprehensive setup for securing your Django applications with JWT-based authentication.
- Introduction
- Installation
- Usage
- Features
- Dependencies
- Configuration
- Documentation
- Examples
- Troubleshooting
- Contributors
- License
The project aims to provide a straightforward example of implementing JWT authentication in applications developed with Django and the Django Ninja framework. It covers user authentication, token generation, and verification processes, ensuring secure access to application resources.
- Clone this repository.
- Install the required dependencies:
- Migrate the database:
- Run the development server:
After installation, you can access the application through the development server's URL, typically http://127.0.0.1:8000/
. The API endpoints for user registration, login, and secure access will be available as defined in the project's URL configurations.
- User registration and login endpoints.
- JWT token generation and verification.
- Secure access to API endpoints with JWT authentication.
This project requires the following packages:
- Django
- Django REST Framework
- Django Ninja
- PyJWT
Configure the project settings in settings.py
, including database configurations, secret keys, and Django Ninja settings. Ensure the JWT authentication settings are correctly set up in ninja_jwt/authentication.py
.
For further documentation on the Django Ninja framework and JWT authentication, please refer to the following:
- Django Documentation
- Django REST Framework Documentation
- Django Ninja Documentation
- PyJWT Documentation
Example usage of the authentication system can be found in ninja_jwt/api.py
. This includes how to define secure endpoints and authenticate requests using JWT.
For common issues related to Django or JWT authentication, consult the official documentation or the project's issue tracker.
This project is licensed under the Apache License, Version 2.0. See the LICENSE file for more details.