A dynamic blog website built with Flask that fetches blog post data from an external API and renders pages using Jinja templates. The app includes a homepage with post previews and individual post pages, along with About and Contact pages.
This project demonstrates Flask routing, template rendering, API data fetching, and modular template structure.
This Flask application serves a multi-page blog site where blog post content is retrieved from a remote JSON API and displayed dynamically.
The app uses:
- Flask routes for page navigation
- Jinja templating for layout reuse
- External API for blog data
- Static assets for styling and images
- Dynamic blog post listing (homepage)
- Individual post pages by ID
- External API data fetch using
requests - Reusable header and footer templates
- About and Contact pages
- Bootstrap-based responsive layout
- Static CSS, JS, and image assets
| Route | Description |
|---|---|
/ |
Show all blog posts |
/post/<id> |
Show full individual post |
/about |
About page |
/contact |
Contact page |
Blog posts are loaded from an external JSON API:
Each post includes:
- Title
- Subtitle
- Author
- Date
- Image URL
- Body content
🗃️ blog-using-flask/
│
├── 🐍 main.py
│
├── 📁 templates/
│ ├── 🌐 about.html
│ ├── 🌐 contact.html
│ ├── 🌐 footer.html
│ ├── 🌐 header.html
│ ├── 🌐 index.html
│ └── 🌐 post.html
│
├── 📁 static
│ ├── 📁 assets
| | ├── 📁 img
| | | ├── 🏞️ about-bg.jpg
| | | ├── 🏞️ contact-bg-jpg
| | | ├── 🏞️ home-bg-jpg
| | | ├── 🏞️ post-bg-jpg
| | | └── 🏞️ post-sample-image-jpg
| | └── 🪟 favicon.ico
│ ├── 📁 css
| | └── 🎨 styles.css
│ └── 📁 js/
| └── 。🇯🇸 scripts.js
└── 📄 README.md
- Flask web framework
- Route handling
- Dynamic URL parameters
- Jinja2 templating
- Template includes (header/footer)
- API consumption with requests
- Server-side rendering
- Static asset management
git clone https://github.com/rohitb281/blog-using-flask.git
cd blog-using-flaskpip install flask requests
python main.py
http://127.0.0.1:5000
- Add database instead of API
- Admin post creation panel
- User authentication
- Comment system
- Search and tags
- Pagination
- Markdown support
- Deployment config
- Read-only blog (no post creation)
- Depends on external API availability
- No database persistence
Open for educational and portfolio use.
Rohit Bollapragada
GitHub: https://github.com/rohitb281