A full-featured blogging application built with Flask, featuring user authentication, password reset, profile management, pagination, and CRUD functionality for blog posts.
✅ 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
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
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
• 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)
🔹 Add a comment system
🔹 Implement a like/upvote feature for posts
🔹 Improve UI with a modern CSS framework
🔹 Enable image uploads for posts
This project is licensed under the MIT License. You are free to use and modify it as per your needs.
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 🎉
👤 Goyam Jain
📧 goyamjain02@gmail.com
🔗 LinkedIn