This project is a Django authentication service implemented with Django Rest Framework (DRF). It includes functionality for user authentication using tokens and token blacklist management.
- Django version: 5.0
- Django Rest Framework version: 3.14.0
- Token-based authentication
- Token blacklist functionality
- User registration, login, logout
- Clone the repository
git clone https://github.com/edonssfall/edAuth-BE.git
- Enter the project directory
cd edAuth-BE
- Copy the
.env.example
file to.env
and update the environment variablescp .env.example .env
- Create a virtual environment and activate it
python3 -m venv venv source venv/bin/activate
- Install the dependencies
pip install -r requirements.txt
- Run the migrations
python manage.py migrate
- Run the development server
python manage.py runserver
Token-based authentication is used in this project. Users can register, login, and logout using their email and password. Tokens are issued upon successful login and must be included in the Authorization header for authenticated requests.
Token blacklist functionality is implemented to invalidate tokens upon logout. When a user logs out, their token is added to the blacklist and cannot be used for authentication thereafter.