- CRUD functionality for Books, Users and Borrowings services
- Create custom permission
- JWT token authentication
- Filtering by active borrowings or by user (only for admin)
- Return Borrowing functionality (custom action)
- Implement the possibility of sending notifications via Telegram chatbot on each Borrowing creation
- Implement a daily-based function for checking borrowings overdue via Celery and if exist sending notifications to Telegram chat
- Install PostgresSQL and create db
- Copy this repository, by using your terminal:
git clone https://github.com/yanpurdenko/drf-library.git- Change directory
cd drf-library- Install venv, and activate it by using following commands:
python -m venv venvto activate on Mac and Linux:
source venv/bin/activateto activate on Windows:
venv\scripts\activate- Install dependencies (requirements):
pip install -r requirements.txt-
Create file .env and change environment variables to yours as in .env.sample.
-
Run migrations to initialize database. Use this command:
python manage.py migrate- Run server
python manage.py runserverDocker should be installed
docker-compose build
docker-compose upAlso use http://127.0.0.1:8000/ url instead of http://0.0.0.0:8000/
Test user credentials:
test@user.com
testpassword- get access token via /api/users/token/
- When you received access token, authorize with it on /api/doc/swagger/ and execute all endpoints
- Or you can install ModHeader extension in Google Chrome and create request header with value Bearer
<Your access token>