This document provides a step-by-step guide on installing dependencies and running a Flask and PostgreSQL CRUD (Create, Read, Update, Delete) application. The application allows managing volunteers' information stored in a PostgreSQL database.
- Python 3.x installed on your system.
- PostgreSQL database installed and running.
-
Flask Installation:
pip install Flask
-
Psycopg2 Installation (PostgreSQL adapter for Python):
pip install psycopg2
-
Clone the Application: Clone or download the application code from the repository.
- Create Database:
- Open PostgreSQL command line or use a GUI tool like pgAdmin.
- Create a new database named
dev
:CREATE DATABASE dev;
-
Configure Database Connection:
- Open
CRUDpy.py
in a editor. - Modify the database connection settings in the following lines using your PostgreSQL user (DB_USER) and password (DB_PASSSWORD)leaving everything else the same:
DB_HOST = 'localhost' DB_NAME = 'dev' DB_USER = 'postgres' DB_PASSWORD = 'password' DB_PORT = "5432"
- Open
-
Run the Application:
python app.py
-
Access the Application:
- Open a web browser and go to
http://localhost:5000/
.
- Open a web browser and go to
-
Adding a Volunteer:
- Fill in the volunteer information in the form and click "Submit".
-
Editing a Volunteer:
- Click on the "Edit" button next to the volunteer you want to edit.
- Modify the volunteer information in the form and click "Update".
-
Deleting a Volunteer:
- Click on the "Delete" button next to the volunteer you want to delete.
- Confirm the deletion when prompted.
This document has provided detailed instructions on installing dependencies and running the Flask and PostgreSQL CRUD application. Follow the steps outlined above to set up and use the application successfully.
If you encounter any issues or have suggestions for improvement, please feel free to reach out and provide feedback.
Ensure to replace <project_directory>
with the actual directory where you have cloned the application. This document should serve as a comprehensive guide for users to set up and utilize the Flask and PostgreSQL CRUD application effectively.