Good-looking, adaptive and powerful library management system website implemented with python package Django, using MySQL for database and materialize for web design, embedded with a lot of nice features.
- Install MySQL
- Install MySQL Workbench
- Create an empty schema named
book
in MySQL - Import
/source/book.sql
file intobook
schema via- Replace
USERNAME
with the your local instance MySQL username, which is usuallyroot
- Replace
PATH
with the actual path of/source/book.sql
file - Input the password for your local instance MySQL afterwards
- Replace
mysql -u USERNAME -p book < PATH
- In
book
schema, the following tables are important:auth_user
stores all the users including readers, staff and superusersbooks
stores the book infolibraries
stores the library infoloans
stores the loan inforeserves
stores the reservationscomments
stores the commentsstorages
stores the storage info
(Recommended, but not necessary!)
- Install PyCharm
- Add Data Source schema
book
at Database in PyCharm- If username and password are required, enter the username and password for your local instance MySQL
Install all required via
pip install -r requirements.txt
Since is the only package needed, you can simply install it via
pip install Django==2.0.5
python manage.py runserver
- Good-looking, neat and adaptive web design
- Sign up, sign in, update user profile, change password, log out
- View all the books
- Search for a book, view book info, storage info, comments
- Add a book, delete a book
- Comment on a book, delete a comment
- Loan a book
- Return date can be extended once at most
- Return a book
- Reserve a book (apply for moving the book from one library to another)
- Confirm a reservation (confirm that the book is moved to another desired library)
- View all comments
- View all reservations
- View all loans
- Django administration site available for superusers
Role | Username | Password |
---|---|---|
superuser | admin000 | person000 |
staff | staff000 | person000 |
staff | staff001 | person000 |
reader | reader000 | person000 |
reader | reader001 | person000 |
- Tourists:
- Sign up
- Readers:
- Sign in, update user profile, change password, log out
- View all the books
- Search for a book, view book info, storage info, comments
- Comment on a book, delete his/her comments
- Loan a book
- Return date can be extended once at most
- Reserve a book (apply for moving the book from one library to another)
- View all comments
- View his/her reservations
- View his/her loans
- Staff:
- Anything that readers can do
- Add a book, delete a book
- Delete any comments
- Return a book (confirm that the book is returned)
- Confirm a reservation (confirm that the book is moved to another desired library)
- View all reservations
- View all loans
- Superusers:
- Anything that staff can do
- log into Django administration site (anything can be changed here)
- Once a book is loaned, the book has to be returned in a month
- The return date can be extended for a month more at most once, which means the book has to be returned in 2 months since the book is loaned
- When a reader tries to return a book, a staff member can confirm that the book is returned
- After a reader tries to reserve a book, a staff member can confirmed that the book is moved to another library that the reader desired
- When a book is loaned or reserved, it can not be deleted
The following command lines are crucial in building this project:
- start django project and app
django-admin startproject lms
python manage.py startapp library
- Let Django builds basic tables in MySQL
python manage.py migrate
- Django models -> MySQL tables
python manage.py makemigrations library
python manage.py migrate
- MySQL tables -> Django models
python manage.py inspectdb > library/models.py
- create superuser
python manage.py createsuperuser
- run server
python manage.py runserver
Zhongyu Chen