This Django project provides simple APIs to manage a relationship between two models - Author and Book.
-
Clone the repository:
git clone https://github.com/anirbanchakraborty123/Library_CRUD_API.git cd library
-
Install dependencies:
pip install -r requirements.txt
-
Apply migrations:
python manage.py makemigrations python manage.py migrate
-
Create a superuser for accessing the Django admin:
python manage.py createsuperuser
-
Run the development server:
python manage.py runserver
-
AUTHOUR APIS:
-
List all authors:
GET v1/api/authors/
-
Retrieve details of a specific author by ID:
GET v1/api/authors/<author_id>/
-
Create a new author:
POST v1/api/authors/
-
BOOK APIS:
-
List all books:
GET v1/api/books/
-
Retrieve details of a specific book by ID:
GET v1/api/books/<book_id>/
-
Create a new book:
POST v1/api/books/
- To access REST API's version-v1 docs:
- 'v1/swagger/'
- 'v1/redoc/'