Online management system for book borrowings.
- JWT authenticated.
- Admin panel /admin/
- Documentation at /api/doc/swagger/
- Books inventory management.
- Books borrowing management.
- Notifications service through Telegram API (bot and chat).
- Scheduled notifications with Django Q and Redis.
- Payments handle with Stripe API.
- create user via /api/users/
- get access token via /api/users/token/
Docker should be installed.
Create .env
file with your variables (look at .env.sample
file, don't change POSTGRES_DB
and POSTGRES_HOST
).
docker-compose build
docker-compose up
Install PostgreSQL and create database.
- Clone project and create virtual environment
git clone git@github.com:phaishuk/Library-API.git
cd LibraryAPI
python -m venv venv
source venv/bin/activate # on MacOS
venv\Scripts\activate # on Windows
pip install -r requirements.txt
- Set environment variables
Check out .env.sample
file -> put all necessary variables -> rename .env.sample
to .env
- Make migrations and run server
python manage.py migrate
python manage.py runserver
- Getting daily scheduled notifications in Telegram
- in settings.py in
Q_CLUSTER
configuration change redis host fromredis
to127.0.0.1
- start Redis server
- run
python manage.py qcluster
- run in separate terminal
python manage.py shell
to open interactive console - to activate scheduled task write in the opened console
from borrowing import tasks
- the task will be first processed in a minute after activating and will be scheduled for the same time the next day
A telegram bot has already been created for this application - https://t.me/libraryapi_bot
- Write any message in bot
- To retrieve chat_id use script
teleram-script.py
. - Add to env variables
chat_id
retrieved by script, to test functionality.