Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Library Management System

A Django web app for a librarian to manage Authors and Books, and track how many copies of each book are on the shelf.

Features Implemented

  • Author and Book models, with Book.author a ForeignKey to Author
  • Full CRUD for both Authors and Books (add / view / edit / delete), using plain function-based views and manual request.POST.get(...) handling (no ModelForm)
  • Basic manual validation on create/edit (required fields, ISBN uniqueness, copies must be non-negative whole numbers, copies available can't exceed copies total)
  • Borrow / Return buttons on the book detail page
    • Borrow: copies_available -= 1 (only if > 0)
    • Return: copies_available += 1 (capped at copies_total)
    • is_available is a @property on the model (copies_available > 0), not a stored field
  • Django Admin — both models registered with a custom list_display
  • Named URLs everywhere ({% url 'book-list' %}, etc.) -> no hardcoded links
  • One base.html with {% block content %}, extended by every page, plus a shared includes/navbar.html

Bonus Features Attempted

  • Search bar on the book list (title or author) and author list (name)
  • Filter books by availability
  • Pagination on both list pages

Project Structure

library_project/
├── librarysystem/        # settings.py, urls.py (all routes live here)
├── library/               # models.py, views.py, admin.py
│   ├── management/commands/seed_data.py
│   └── migrations/
├── templates/              
│   ├── base.html
│   ├── includes/navbar.html
│   └── *.html
├── manage.py
├── requirements.txt
└── README.md

Setup / Installation

  1. Clone the repo and move into the project folder:
    git clone <your-repo-url>
    cd library_project
  2. Create and activate a virtual environment:
    python3 -m venv venv
    source venv/bin/activate      # Windows: venv\Scripts\activate
  3. Install dependencies:
    pip install -r requirements.txt
  4. Run migrations:
    python manage.py migrate
  5. (Optional) load sample data:
    python manage.py seed_data
  6. (Optional) create an admin superuser:
    python manage.py createsuperuser
  7. Run the server:
    python manage.py runserver
  8. Visit http://127.0.0.1:8000/ — admin panel at /admin/.

Screenshots

![Book List](screenshots/all_book.png)
![Add Book Form](screenshots/add_book.png)
![Author List](screenshots/all_authors.png)
![Add Author Form](screenshots/add_author.png)
![Book List-Admin Section](screenshots/admin_book.png)
![Author List-Admin Section](screenshots/admin_authors.png)

Tech Stack

  • Python 3 / Django 6.0
  • SQLite (default)
  • Bootstrap 5 (via CDN)

About

A web-based Library Management System built with Python and Django to manage books, authors, and user records.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages