https://github.com/ajitagupta/flask-guestbook
Multi-page app in Flask
https://github.com/ajitagupta/flask-guestbook
flask guestbook-app multi-page-app python tutorial-series
Last synced: 7 months ago
JSON representation
Multi-page app in Flask
- Host: GitHub
- URL: https://github.com/ajitagupta/flask-guestbook
- Owner: ajitagupta
- License: mit
- Created: 2025-06-06T15:10:01.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2025-06-06T15:18:46.000Z (11 months ago)
- Last Synced: 2025-06-06T16:25:20.063Z (11 months ago)
- Topics: flask, guestbook-app, multi-page-app, python, tutorial-series
- Language: HTML
- Homepage:
- Size: 13.7 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 📝 Flask Guestbook App
A beginner-friendly Flask project that demonstrates:
- Multi-page routing
- Template inheritance with Jinja2
- Form handling (GET & POST)
- Basic CSS styling
- In-memory data storage
This is Part 3 of a tutorial series on building web apps with Flask.
---
## 🚀 Demo
- 🏠 **Home Page** – A welcome message
- 📖 **Guestbook Page** – Users can leave their name and a message
- 🎨 **Styled UI** – Uses `static/style.css` for basic formatting
- 🔄 **Reset Route** – Clears all guestbook entries for testing
---
## 📁 Project Structure
flask-guestbook/
├── app.py # Main Flask application
├── static/ # Static files (CSS, JS, images)
│ └── style.css # Styling for form and layout
└── templates/ # Jinja2 HTML templates
│ └── base.html # Shared base template
│ └── home.html # Home page content
│ └── guestbook.html # Guestbook form and entries
---
## 💡 How It Works
- Routes:
- `/` – Home
- `/guestbook` – View and submit entries
- `/reset` – (Bonus) Clears all messages
- Templates:
- `base.html` provides the layout
- Other pages extend `base.html` using `{% extends %}`
- Styling:
- Basic form and navigation styling in `style.css`
---
## 🛠️ Getting Started
### 1. Install Dependencies
```bash
pip install Flask
```
### 2. Run the App
```bash
python app.py
```
### 3. Open in Browser
```bash
Go to http://127.0.0.1:5000
```
## 📦 Features
✅ Clean template structure
✅ Dynamic routing with url_for
✅ Form validation with required fields
✅ Auto-redirect on submission to prevent resubmission
✅ Reset functionality for demo/testing
## 📚 Next Steps
Connect to SQLite or another database
Add user sessions and flash messages
Deploy to Heroku or Render
## 📄 License
MIT – Free to use, modify, and distribute.
## 🙋♀️ Author
Made with ❤️ by Ajita Gupta
Follow the tutorial series on Medium