This repository contains my progress while following Miguel Grinberg's Flask Mega-Tutorial. I am building a full-featured microblogging application step-by-step, implementing features like user authentication, a database, and a responsive UI.
I have successfully completed up to Chapter 11: Facelift, which introduces a Bootstrap-based redesign of the application.
- Chapter 1: Hello, World!
- Chapter 2: Templates
- Chapter 3: Web Forms
- Chapter 4: Database
- Chapter 5: User Logins
- Chapter 6: Profile Page and Avatars
- Chapter 7: Error Handling
- Chapter 8: Followers
- Chapter 9: Pagination
- Chapter 10: Email Support
- Chapter 11: Facelift (Bootstrap 5 UI)
- Chapter 12: Dates and Times (moment.js & Flask-Moment)
- Chapter 13: I18n and L10n (Flask-Babel, CLI translation commands)
The application currently includes the following functionalities:
- User Management: Registration, authentication, and user sessions.
- User Profiles: Profile pages with avatars (via Gravatar).
- Posts & Interactions: Posting and displaying user posts with a followers/following system.
- Post Pagination: Pagination for browsing posts.
- Error Handling: Custom error pages for 404 and 500 errors.
- Email Support: Sending emails for password reset.
- Frontend: A responsive and modern UI using Bootstrap 5.
- Dates and Times: Time zone–aware timestamps with Flask-Moment (Chapter 12).
- Internationalization: Multi-language support using Flask-Babel, translation markers (
_()/_l()), language catalog management, and translation CLI commands (Chapter 13).
- Flask: A lightweight Python web framework.
- Flask-WTF: For handling web forms.
- Flask-Login: For managing user sessions and authentication.
- Flask-Mail: For email support.
- Flask-Migrate & SQLAlchemy: For database migrations and object-relational mapping (ORM).
- Flask-Moment: Client-side timestamps with moment.js (Dates & Times).
- Flask-Babel: Internationalization & localization (I18n & L10n).
- Bootstrap 5: For frontend styling and UI components.
Follow these steps to get the application up and running on your local machine.
-
Clone the repository:
git clone [https://github.com/](https://github.com/)<your-username>/<your-repo-name>.git cd <your-repo-name>
-
Create and activate a virtual environment:
python -m venv venv # On Linux/macOS source venv/bin/activate # On Windows venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Set environment variables:
# On Linux/macOS export FLASK_APP=microblog.py export FLASK_ENV=development # On Windows set FLASK_APP=microblog.py set FLASK_ENV=development
-
Initialize the database:
flask db upgrade
-
Run the application:
flask run
This is a work-in-progress repository. As I continue the tutorial, I will add more features, including APIs, background jobs, testing, and deployment.