/BooksCollectionCURD

CURD operation using Django and Postgresql

Primary LanguagePython

BooksCollectionCURD

CURD operation using Django and Postgresql

Installation

  1. Clone the Repository
https://github.com/karuna-sth/BooksCollectionCURD.git 
  1. Navigate the directory
cd bookcollection
  1. Create virtual environment and activate
py -m venv env
env/scripts/activate
  1. Install requirements
pip install -r requirements.txt
  1. Change Database information in setting.py
DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql_psycopg2',
        'NAME': 'Books',
        'USER': 'YourUsername',
        'PASSWORD': 'YourPassword',
        'HOST': 'localhost',
    }
}
  1. Make migration in database
python manage.py migrate

Usage

  1. Start server
python manage.py runserver
  1. open web browser and navigate to http://127.0.0.1:8000/

Endpoints

  • / : Show List of books from retrieved from database
  • /addbook : Add new book to list
  • /deletebook/<id> Delete an book by id and redirect to home page
  • /editbook/<id> Update book details by id

Screenshots

home addbook editbook