A web-based Library Management System built using Python's Django, HTML, CSS, and MySQL Database. It provides functionalities for managing books, authors, borrowers, and book loans, including features for searching, checking out, and checking in books, as well as managing fines.
- Book Management:
- Add, view, update, and delete book records (ISBN, title).
- Associate books with authors.
- Borrower Management:
- Register new borrowers (name, SSN, address, phone).
- View a list of registered borrowers.
- Book Loan Management:
- Check out available books to registered borrowers.
- Record the date out and due date for loans.
- Check in returned books, recording the return date.
- Search Functionality:
- Search for books by ISBN, title, or author.
- Fine Management:
- Automatically calculate fines for overdue books.
- Display total fines for each borrower.
- Option to mark fines as paid.
- User Interface:
- Intuitive and user-friendly web interface built with Django templates.
)
-
Prerequisites:
- Python 3.8+ installed (https://www.python.org/downloads/)
- Git installed (https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)
-
Clone the repository:
git clone https://github.com/SpitsEric/Library-Management-System.git cd Library-Management-System -
Set up a virtual environment:
python3 -m venv venv source venv/bin/activate # On macOS/Linux # venv\Scripts\activate # On Windows
-
Install dependencies:
pip install -r requirements.txt
-
Configure the
.envfile:-
This project uses a
.envfile to store database credentials. -
In the root of the project, create a file named
.env. -
Add your MySQL connection details to this file in the following format (replace with your actual credentials):
DATABASE_ENGINE=django.db.backends.mysql DATABASE_NAME=library # Or your database name DATABASE_USER=your_mysql_username DATABASE_PASSWORD=your_mysql_password DATABASE_HOST=localhost # Or your MySQL host DATABASE_PORT=3306 # Or your MySQL port
-
-
Install
python-dotenv: If you haven't already, ensure thepython-dotenvlibrary is installed in your virtual environment, as Django will need it to load environment variables from the.envfile:pip install python-dotenv
-
Run migrations:
python manage.py migrate
-
Run the development server:
cd LibraryManagementSystem python manage.py runserver -
Open your web browser and navigate to
http://127.0.0.1:8000/(orhttp://127.0.0.1:8000/library/if you have a redirect).