This project is an authentication API using Django Rest Framework and dj-rest-auth.
- URL:
api/auth/register/
- Method:
POST
- Description: Registers a new user.
- Example Request:
{ "username": "user", "password1": "password", "password2": "password", "email": "user@example.com" }
- URL:
api/auth/login/
- Method:
POST
- Description: Authenticates a user and returns access tokens.
- Example Request:
{ "username": "user", "password": "password" }
- URL:
api/auth/logout/
- Method:
POST
- Description: Logs out the authenticated user.
- URL:
api/auth/user/
- Method:
GET
- Description: Returns details of the authenticated user.
- URL:
api/auth/token/verify/
- Method:
POST
- Description: Verifies the validity of a token.
- Example Request:
{ "token": "your-token" }
- URL:
api/auth/token/refresh/
- Method:
POST
- Description: Refreshes the access token.
- Example Request:
{ "token": "your-token" }
- Clone the repository:
git clone https://github.com/your-username/your-repo-name.git
cd your-repo-name
- Install Poetry if you haven't already:
pip install poetry
- Install the dependencies:
poetry install
- Apply migrations:
poetry run python manage.py migrate
- Run the development server:
poetry run python manage.py runserver
Use a tool like Postman or httpie to interact with the API endpoints.