2.5 Controller Limitations: The Advantages of Models and Views
The Controller is very powerful: with only three lines, Django has allowed us to create a basic webpage.
The Controller is, however, also very limited. Consider that our webpage is currently plain text. We are not building an HTML page, as all browsers expect us to. We could manually build out an HTML page, but doing so becomes cumbersome, as we shall discover in the beginning of Chapter 4.
Even more problematic is that we are only building static content right now. If we want to change the content, we have to add or change it manually. Instead, we want the ability to dynamically generate pages. Imagine being able to tell Django to print "Hello
{object
}".format(object=a_python_variable) ...
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.