Skip to content

yanpurdenko/drf-library

Repository files navigation

API service for library written on DRF

Features implemented:

  1. CRUD functionality for Books, Users and Borrowings services
  2. Create custom permission
  3. JWT token authentication
  4. Filtering by active borrowings or by user (only for admin)
  5. Return Borrowing functionality (custom action)
  6. Implement the possibility of sending notifications via Telegram chatbot on each Borrowing creation
  7. Implement a daily-based function for checking borrowings overdue via Celery and if exist sending notifications to Telegram chat

Installing using GitHub

  1. Install PostgresSQL and create db
  2. Copy this repository, by using your terminal:
git clone https://github.com/yanpurdenko/drf-library.git
  1. Change directory
cd drf-library
  1. Install venv, and activate it by using following commands:
python -m venv venv

to activate on Mac and Linux:

source venv/bin/activate

to activate on Windows:

venv\scripts\activate
  1. Install dependencies (requirements):
pip install -r requirements.txt
  1. Create file .env and change environment variables to yours as in .env.sample.

  2. Run migrations to initialize database. Use this command:

python manage.py migrate
  1. Run server
python manage.py runserver

Run with docker

Docker should be installed

docker-compose build
docker-compose up

Also use http://127.0.0.1:8000/ url instead of http://0.0.0.0:8000/

Getting access

Test user credentials:

test@user.com
testpassword
  • get access token via /api/users/token/

How to try it out

  1. When you received access token, authorize with it on /api/doc/swagger/ and execute all endpoints
  2. Or you can install ModHeader extension in Google Chrome and create request header with value Bearer <Your access token>

About

API service for library written on DRF

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors