Python build the network -> on template inheritance, display multiple themes, display a specific entry

Making website set up more complex pages when the first contact with the data, find it hard to deal with. In particular, a greater amount of data, when more data entries.

In this case you should always put my main line, on data processing, from whole to part, means gradually refined, and its careful work attitude.

1. template inheritance:

  The so-called template inheritance, is to be presented to each common part of the inside pages of the user in the form of a parent template independent, then it is inherited by each template. The advantage is that only need to care about the uniqueness of each template, without having to always consider all of the features.

2. Display multiple themes: making the page must be created to seize the main line, what I want to show is what I want to create out of thin air is what I want to transfer data. For example, it: when the page is displayed during the creation of multiple themes.

  * Start by creating a URL pattern, the page definition will be presented a url path and specify this path will be provided by that view, and then proceeds related to the preparation of view, trying to write during the time is bound to consider:

  I inherit the data from the model in those models, and how to process the data, and finally what you want to view the data passed to the template (template web page that is what I want to render the data to the user), and then will be taken into account

  How to create a template, how to deal with inherited by the view over the data, then the relevant data or need to link to other pages in the template, if required will naturally occur to create specific web page template.

3 shows a specific entries: and step 2 is similar.

Guess you like

Origin www.cnblogs.com/zzuwk/p/11580667.html