An open API service indexing awesome lists of open source software.

https://github.com/goyam02/flask_blog

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.
https://github.com/goyam02/flask_blog

blog bootstrap css database flask form forms html javascript post python sqlalchemy sqlalchemy-python templates user-authentication virtualenv

Last synced: about 2 months ago
JSON representation

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.

Awesome Lists containing this project

README

          

# πŸ“ 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](screenshots/home.png)


# πŸš€ 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
``` bash
git clone https://github.com/yourusername/Flask_Blog.git
cd Flask_Blog
```
2️⃣ Create a Virtual Environment
```bash
python -m venv venv
source venv/bin/activate # On macOS/Linux
venv\Scripts\activate # On Windows
```
3️⃣ Install Dependencies
```bash
pip install -r requirements.txt
```
4️⃣ Set Up Environment Variables
```bash
SECRET_KEY=your-secret-key
EMAIL_USER=your-email@gmail.com
EMAIL_PASS=your-email-app-password
```
Or set them manually:
```bash
export SECRET_KEY="your-secret-key"
export EMAIL_USER="your-email@gmail.com"
export EMAIL_PASS="your-email-app-password"
```
5️⃣ Initialize the Database
```bash
flask db init
flask db migrate -m "Initial migration"
flask db upgrade
```
6️⃣ Run the Application
```bash
python run.py
```


# πŸ“Έ Screenshots

### πŸ”Ή Login Page
![Login Page](screenshots/login.png)

### πŸ”Ή Register Page
![Register Page](screenshots/register.png)

### πŸ”Ή Home Page
![Home Page](screenshots/home.png)

### πŸ”Ή Account Page
![Account Page](screenshots/account.png)


# πŸ”§ 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](https://github.com/Goyam02/Flask_Blog/blob/master/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](https://www.linkedin.com/in/goyam02)


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