Skip to content

Goyam02/Flask_Blog

Repository files navigation

📝 Flask Blog

A full-featured blogging application built with Flask, featuring user authentication, password reset, profile management, pagination, and CRUD functionality for blog posts.

Home Page


🚀 Features

✅ User Authentication (Register, Login, Logout)
✅ Profile Management (Update profile picture & username)
✅ Password Reset via Email
✅ CRUD for Blog Posts (Create, Read, Update, Delete)
✅ Pagination for Posts
✅ User-Specific Post Feed
✅ Secure Password Hashing with Bcrypt
✅ Flask-Mail for Email Notifications


📂 Project Structure

Flask_Blog/
│── flaskblog/
│   ├── __init__.py        # Initialize Flask app & extensions
│   ├── routes.py          # App routes (login, register, posts, etc.)
│   ├── models.py          # Database models (User, Post)
│   ├── forms.py           # Flask-WTF forms for authentication & posts
│   ├── static/            # Static assets (CSS, images)
│   ├── templates/         # HTML templates
│       ├── layout.html    # Main template structure
│       ├── login.html     # User login page
│       ├── register.html  # User registration page
│       ├── post.html      # Individual post page
│       ├── user_post.html # Posts by a specific user
│       ├── reset_request.html  # Request password reset page
│       ├── reset_token.html    # Reset password page
│	├── about.html	   # About page
│	├── account.html   #  User profile page (edit details & change profile picture)
│	├── create_post.html	# Page to create a new blog post
│	├── home.html	   #  Home page displaying blog posts
│	├── main.html	   # Base template extended by other templates
│
│   ├── site.db            # SQLite database (ignored in .gitignore)
│── config.py              # Application configuration (environment variables)
│── run.py                 # Entry point for running the app
│── requirements.txt       # Dependencies
│── screenshots/           # ✅ Screenshots folder for README
│   ├── account.png
│   ├── login.png
│   ├── register.png
│   ├── home.png               
│── .gitignore             # Prevents sensitive files from being committed
│── README.md              # Project documentation

⚡ Installation & Setup

1️⃣ Clone the Repository

git clone https://github.com/yourusername/Flask_Blog.git
cd Flask_Blog

2️⃣ Create a Virtual Environment

python -m venv venv
source venv/bin/activate  # On macOS/Linux
venv\Scripts\activate  # On Windows

3️⃣ Install Dependencies

pip install -r requirements.txt

4️⃣ Set Up Environment Variables

SECRET_KEY=your-secret-key
EMAIL_USER=your-email@gmail.com
EMAIL_PASS=your-email-app-password

Or set them manually:

export SECRET_KEY="your-secret-key"
export EMAIL_USER="your-email@gmail.com"
export EMAIL_PASS="your-email-app-password"

5️⃣ Initialize the Database

flask db init
flask db migrate -m "Initial migration"
flask db upgrade

6️⃣ Run the Application

python run.py

📸 Screenshots

🔹 Login Page

Login Page

🔹 Register Page

Register Page

🔹 Home Page

Home Page

🔹 Account Page

Account Page


🔧 Technologies Used

•	Flask (Backend Framework)
•	Flask-SQLAlchemy (ORM for Database)
•	Flask-WTF (Forms & Validation)
•	Flask-Mail (Sending Emails)
•	Flask-Login (User Authentication)
•	Bcrypt (Password Hashing)
•	SQLite (Database)
•	Bootstrap (Frontend Styling)

🛠 Future Improvements

🔹 Add a comment system
🔹 Implement a like/upvote feature for posts
🔹 Improve UI with a modern CSS framework
🔹 Enable image uploads for posts


📜 License

This project is licensed under the MIT License. You are free to use and modify it as per your needs.


⭐ Contributing

1.	Fork the repository
2.	Create a new branch (git checkout -b feature-branch)
3.	Commit changes (git commit -m "Added new feature")
4.	Push to GitHub (git push origin feature-branch)
5.	Open a Pull Request 🎉

📬 Contact

👤 Goyam Jain
📧 goyamjain02@gmail.com
🔗 LinkedIn


🌟 If you found this project useful, don’t forget to give it a star! ⭐

About

Flask_Blog is a web application built using Flask, a lightweight web framework in Python. It is designed for users to create, edit, and share blog posts seamlessly.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors