CURD operation using Django and Postgresql
- Clone the Repository
https://github.com/karuna-sth/BooksCollectionCURD.git
- Navigate the directory
cd bookcollection
- Create virtual environment and activate
py -m venv env
env/scripts/activate
- Install requirements
pip install -r requirements.txt
- Change Database information in setting.py
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'Books',
'USER': 'YourUsername',
'PASSWORD': 'YourPassword',
'HOST': 'localhost',
}
}
- Make migration in database
python manage.py migrate
- Start server
python manage.py runserver
- open web browser and navigate to
http://127.0.0.1:8000/
/
: 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