A simple web-based contact book application built with Flask that allows users to add and view contact information.
- Add new contacts with name and email
- View all submitted contacts in a list below the form
- Simple and clean web interface
- Form validation for required fields
- Hungarian language interface
contact_book/
├── app.py # Main Flask application
└── index.html # HTML template for the web interface
- Python 3.x
- Flask
- Clone or download this repository
- Navigate to the project directory
- Install Flask:
pip install flask
- Navigate to the
contact_bookdirectory:cd contact_book - Run the Flask application:
python app.py
- Open your web browser and go to:
http://localhost:5000 - Use the form to add contacts:
- Enter a name in the "Név" field
- Enter an email address in the "Email" field
- Click "Hozzáadás" (Add) to submit
The Flask application includes:
- A single route (
/) that handles both GET and POST requests - In-memory storage for contacts using a Python list
- Form data processing for name and email fields
The HTML template features:
- Simple form with name and email input fields
- Form validation (required fields)
- Display of all submitted contacts in a list below the form
- Hungarian language labels and interface
- User visits the homepage (GET request)
- Flask renders the
index.htmltemplate - User fills out the form and submits (POST request)
- Flask processes the form data and adds it to the contacts list
- Flask rerenders the
index.htmltemplate with the updated contacts list