15.3 Anatomy of the App

The flatpages app is like any other Django app—it doesn’t magically allow for the creation of webpages without a database. In fact, the webpages created by the app are actually instances of the FlatPage model class. Flatpages are full webpages that are stored in the database.

For the flatpages app to create the illusion of a static page, the app supplies a view to display FlatPage instances in. The app also supplies a URL configuration for developers to include in the root URL configuration. Perhaps surprisingly, the app also provides a form to create FlatPages, which is mainly used by the admin app (which we’ll see in Chapter 23: The Admin Library).

The app also provides middleware. Originally, the app used the middleware ...

Get Django Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.