ldn_library is a Django-based web application designed to manage a library system. It provides functionalities for adding books, deleting books, inserting users, and borrowing books.
- Add Book: Users can add books to the library database by providing the title, author, and other relevant information.
- Delete Book: Users with appropriate permissions can delete books from the library database based on the book's ID.
- Insert User: Users can be added to the system by providing their first name, last name, and email address.
- Borrow Book: Users can borrow books from the library by specifying the book ID and user ID.
-
Clone the repository:
git clone [repository-url](https://github.com/LOUDINISouad/ldn_library) cd ldn_library
-
Activate the virtual environment:
source venv/bin/activate # Linux/Mac # Or .\venv\Scripts\activate # Windows
-
Apply migrations:
python manage.py migrate
-
Run the development server:
python manage.py runserver
- You can access the application's web interface by opening your web browser and navigating to http://localhost:8000/MyLibrary/.
- Alternatively, you can use Postman to interact with the application's API endpoints directly.
- Postman allows you to send HTTP requests to the API endpoints and view the responses.
- Here's how you can use Postman to interact with the API endpoints:
- Open Postman.
- Create a new request.
- Set the request type (GET, POST, DELETE, etc.).
- Enter the URL for the desired API endpoint (e.g.,
http://localhost:8000/MyLibrary/books
). - Send the request and view the response.
- Add Book:
POST /MyLibrary/books
- Delete Book:
DELETE /MyLibrary/books/<book_id>
- Insert User:
POST /MyLibrary/users
- Borrow Book:
POST /MyLibrary/borrow_book/<book_id>/<user_id>