11 I’ve got something to say

 

This chapter covers

  • Creating and modifying MyBlog content posts
  • Creating and displaying content posts
  • Creating and displaying post comments
  • Notifying users about posts and comments
  • Handling errors

At long last, we’re at the point of adding content to the MyBlog application. Everything we’ve done so far to build the application has been aimed at creating the infrastructure to enable posting content to the blog.

You’ve created a database to persist information the MyBlog application manages over time. In addition, you’ve created users with roles so those users can register with and use the application. You’ve also modularized the application using Flask Blueprints to help manage the app’s growing complexity, which adds structure and control to the application to help you and your users create and manage content on the MyBlog application.

Let’s establish a naming convention to help us discuss content. Content is the engaging information a user writes and other users read and comment on. Content has an author, a creation timestamp, an update timestamp, and a title. The author, timestamps, and title are all associated with the content and its metadata. We’ll gather this information into what we’ll call a post, like on a bulletin board, where a user “posts” information they want others to read.

11.1 MyBlog posts

11.1.1 Modeling the database

11.2 Change of direction

11.3 Content Blueprint

11.4 Displaying and creating posts

11.4.1 Display handler

11.4.2 Display template

11.5 Creating posts

11.5.1 Creation handler

11.5.2 Creation form

11.5.3 Creation template

11.6 Displaying and editing a post

11.6.1 Display handler