Run the project on the local machine
-run script
pip install -r requirements.txt
python manage.py makemigrations
python manage.py runserver
- Navgiate http://127.0.0.1:8000/
- Also, you can experiement the API on django rest framework standard UI.(http://127.0.0.1:8000/api/books/)
- You will see the Swagger UI
Filter Feature by genere
- you have to provide the genere filter data on the query parameters
for example: http://127.0.0.1:8000/api/books/?genere=Fantasy&genere=Horror&genere=LF
then, by default, we list the book with"OR"
operator for genere field. that is; list all the books whose genere isFantasy
orHorror
orLF
. - However, if you specify
and
query param as"true"
,
It lists the books witAND
operator. example url:http://127.0.0.1:8000/api/books/?genere=Fantasy&genere=Horror&genere=LF
&and=true`