This project is a RESTful API for managing a book inventory.
- Manage book inventory (add, update, delete books)
- User authentication and authorization
- Search functionality for books by ID
- Python 3.7+
- Django 3.2+
- Django REST Framework 3.12+
-
Clone the Repository or Download the Zip:
git clone https://github.com/harshongithub/bookstore_api.git cd bookstore_api
-
Create and Activate a Virtual Environment:
python -m venv venv
- On Windows:
venv\Scripts\activate
- On macOS/Linux:
source venv/bin/activate
- On Windows:
-
Install the Required Packages:
pip install -r requirements.txt
-
Apply Migrations:
python manage.py migrate
python manage.py makemigrations
-
Create a Superuser:
python manage.py createsuperuser
To run the development server:
python manage.py runserver
The API will be available at http://localhost:8000.
/api/books/
: List all books or create a new book (Authentication required for creating a new book)/api/books/<id>/
: Retrieve, update, or delete a specific book (Authentication required for update and delete)/api/login/
: To log in/api/register/
: To register as a new user/api/token/refresh/
: To get a new access token/api/admin/
: To access the admin panel
For detailed documentation of the API endpoints, visit Postman Documentation.