Skip to content

rohitb281/blog-using-flask

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

📝 Blog Website — Flask Dynamic Blog App

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.


📌 Overview

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

⚙️ Features

  • 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

🌐 Routes

Route Description
/ Show all blog posts
/post/<id> Show full individual post
/about About page
/contact Contact page

🔌 Data Source

Blog posts are loaded from an external JSON API:

Blog Post Link

Each post includes:

  • Title
  • Subtitle
  • Author
  • Date
  • Image URL
  • Body content

🧱 Project Structure

🗃️ 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

🧠 Concepts Demonstrated

  • Flask web framework
  • Route handling
  • Dynamic URL parameters
  • Jinja2 templating
  • Template includes (header/footer)
  • API consumption with requests
  • Server-side rendering
  • Static asset management

▶️ How to Run

Clone repository

git clone https://github.com/rohitb281/blog-using-flask.git
cd blog-using-flask

Install dependencies

pip install flask requests

Run the app

python main.py

Open browser:

http://127.0.0.1:5000

🚀 Possible Improvements

  • Add database instead of API
  • Admin post creation panel
  • User authentication
  • Comment system
  • Search and tags
  • Pagination
  • Markdown support
  • Deployment config

⚠️ Limitations

  • Read-only blog (no post creation)
  • Depends on external API availability
  • No database persistence

📄 License

Open for educational and portfolio use.


👤 Author

Rohit Bollapragada

GitHub: https://github.com/rohitb281