3. Storing Data in your Model

In the previous chapter, we created our first Django application and got it running. That application gave us some experience with the structure of a Django project and an application in the project.

In particular, we set up two of the three primary parts of a Django application: the view and the template. We created two views: one that simply passed a text string containing HTML to the browser, and one that passed variables to the template. The variables in question contained text strings corresponding to the resulting Web page’s title, header, and text. The template we created and connected to the application read the data passed to it through the Context object. The template read variables by name and inserted ...

Get Django: Visual QuickPro Guide now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.