15.8 Putting It All Together

When asked if Django allows for static webpages, people nod their head, say yes, and then tell others to use the flatpages app for that purpose. But we now know this is a bald-faced lie. The flatpages app, like everything in Django, relies on the MVC architecture provided by Django. The app provides a FlatPage model, which stores full webpages in the database, which are rendered in a template, thanks to a view, and pointed to by a URL pattern (or middleware).

The net effect is that, yes, Django provides the tools necessary to store a “static” webpage that a user can then request. However, the page is not truly static—it is being generated, which is desirable! If we change the navigation menu—as we did in this chapter—the ...

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.