Project tutorial

Build a Flask Blog

Build Campus Wire, an original Flask blog for Free Computer Courses: routes, Jinja templates, forms, SQLite, auth, CRUD posts, pagination, and a production-minded deploy snapshot.

  • Difficulty Intermediate
  • Parts 8
  • Stack Python, Flask, Jinja2, Flask-WTF, SQLAlchemy, Flask-Login, SQLite

How this project works

Campus Wire is a teaching blog you build in small, complete steps. Each numbered folder in fcc-flask-blog is a working app at that stage of the curriculum. You can clone once, open any snapshot, and run it without finishing every earlier part first.

If you already know a little Python—functions, dictionaries, and how to run a script—you have enough to start. Flask will feel new at first, so each part explains the ideas in plain language before asking you to run code. You will see why a route exists, what a template is for, and how a form or database change shows up in the browser.

The path is deliberate: one route and a greeting, then Jinja templates and a shared layout, then validated forms, then SQLite models, then login, then create/edit/delete for posts, then pagination, then environment-based config for deploy. Later snapshots keep the same overall shape so you can compare folders and see what changed.

Code in this project is original Free Computer Courses material for Campus Wire. It is not a copy of third-party Flask tutorial repositories. Use it alongside the Python and SQL courses when you want deeper practice on language or database topics that appear along the way.

Work in a virtual environment for every snapshot, install from the repo-root requirements.txt, and treat each part’s “what you should see” notes as your checkpoint. When something fails, the troubleshooting sections cover the mistakes beginners hit most often with Flask: wrong folder, inactive venv, missing SECRET_KEY, and forgetting an app context for database work.

Start with part 1 Open GitHub repo

Parts in order

Work through the parts in sequence. Each lesson explains the ideas in plain language, then points you to a complete runnable snapshot on GitHub for that stage.

  1. Part 1: Getting StartedInstall Flask in a virtual environment and serve a one-route “Hello, Blog!” app.
  2. Part 2: TemplatesRender Jinja2 pages with a shared base layout, home feed, and about page.
  3. Part 3: FormsValidate a PostForm with Flask-WTF, show field errors, and flash success messages.
  4. Part 4: DatabaseMap User and Post models to SQLite with Flask-SQLAlchemy and seed sample rows.
  5. Part 5: AuthenticationRegister and log in users with Flask-Login and hashed passwords.
  6. Part 6: Posts CRUDCreate, view, edit, and delete posts — only the owner can change a post.
  7. Part 7: PaginationPaginate the home feed so large blogs stay fast and readable.
  8. Part 8: DeployRead secrets from the environment and prepare Campus Wire for hosting.