A Flask-based web application for managing contacts. This application intentionally has some bugs for educational purposes in software testing.
- Python 3.8 or higher
- pip (Python package installer)
- Git
git clone <repository-url>
cd lab6# Create virtual environment
python3 -m venv venv
# Activate virtual environment
source venv/bin/activate# Create virtual environment
python -m venv venv
# Activate virtual environment
venv\Scripts\activateWith the virtual environment activated, install the required packages:
pip install -r requirements.txtWhen running the application for the first time, the database will be automatically created.
# Make sure your virtual environment is activated
source venv/bin/activate
# Run the application
python3 app.py# Make sure your virtual environment is activated
venv\Scripts\activate
# Run the application
python app.pyThe application will be available at http://localhost:5001
- Create new contacts
- View list of contacts
- Update existing contacts
- Delete contacts
- Search contacts
- RESTful API endpoints
- GET
/api/contacts- List all contacts - GET
/api/contacts/<id>- Get a specific contact - POST
/api/contacts- Create a new contact - PUT
/api/contacts/<id>- Update a contact - DELETE
/api/contacts/<id>- Delete a contact
lab6/
├── app.py # Main Flask application
├── models.py # Database models
├── forms.py # Form definitions
├── requirements.txt # Project dependencies
├── templates/ # HTML templates
│ ├── base.html
│ ├── index.html
│ ├── contacts.html
│ ├── add_contact.html
│ └── update_contact.html
└── static/
└── js/
└── search.js
If you get an error about port 5001 being in use:
- Change the port number in
app.py - Or kill the process using the port:
# For macOS/Linux lsof -i :5001 kill -9 <PID> # For Windows netstat -ano | findstr :5001 taskkill /PID <PID> /F
If you have problems with the virtual environment:
- Delete the
venvdirectory - Re-create it following the installation steps above
If you encounter database problems:
- Delete the
contacts.dbfile - Restart the application to create a fresh database
When you're done working on the project:
deactivateThis application contains intentionally introduced bugs for educational purposes in software testing. These bugs are distributed across different components of the application.