WARNING!! (You need to have docker and docker-compose installed)
- Create empty folder
- There pass the command:
git clone https://github.com/lyf2000/clickbook.git - In
Dockerfileput your Google account creditsENV EMAIL_HOST_USER <google email> ENV EMAIL_HOST_PASSWORD <password>
- Run the following commands:
docker build . # wait a time... bunch of inputs... docker-compose run web python /code/manage.py migrate ... docker-compose run web python /code/manage.py createsuperuser # here you've gotta to put credits to your superuser (username, email, password) ... docker-compose up -d --build - There is! You just need to open
http://localhost:8000/admin/page and create new books
First of all, you need to specify all admin-emails that will be notified about new order, just open 'clickbook/settings.py' and add new emails to the list:
ADMINS = [
('Name', 'lyf2000@mail.ru'),
...
]
List of APIs:
- Registration
/signup/POST body:{ "username": "<new username>" "password": "<your password>" } - Authorization. Here You're getting
access_tokenwhich is gotta to be put inAuthorizationheader/login/POST body:{ "username": "<your username>" "password": "<your password>" } - Books
/books/GET you will get:[ ... { "id": <int>, "name": <string>, "cost": <int>, "author": { "id": <int>, "fio": <string> } } ... ] - Authors
/authors/GET you will get:[ ... { "id": <int>, "fio": <string> "books_count": <int>, "books": { "id": <int>, "name": <string>, "cost": <int> } } ... ] - Order book. You need to have header
Authorization: Bearer <token>. '/books/order/' POST body:"book": <book id>, "call": <phone number int>, "comment": <string> # OPTIONAL