ilaunchpad / library_mgmt

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

libraryManagement poc for api usage in django framework through library management tools Rough outline ''' Have a rest api with endpoints for User creation Book checkout Book return Book creation

Use a postgres database to store the users, books, checkouts Only allow users tp check out 3 books at a time in due date Keep trak of which books are checked out so you can't loan out books that aren't in stock

django library management

Requirements: django 4.1.3 python3 postgres 13.4

#Create postgres database running on port 5432. Tweak database settings in settings.py in section DATABASES DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql', 'NAME': 'library', 'USER': 'user', 'PASSWORD': '', 'HOST': '127.0.0.1', 'PORT': '5432' } } Steps to create postgres database

  • run initdb -D data-lib
  • postgres -D data-lib -p 5432
  • createdb -p 5432 library
  • pg_ctl -D data-lib start
  • psql -p 5432 library
  • create user 'user' with superuser

Steps to set up the app

  • cd into the root directory of the project:library_mgmt
  • python3 manage.py makemigrations
  • python3 manage.py migrate

Creating an admin user

  • python3 manage.py createsuperuser
  • input username:admin
  • input email
  • input password

Run the app

  • python3 manage.py runserver

Use the app

About


Languages

Language:Python 78.0%Language:HTML 22.0%