开发者

Dynamic blocks in django templates

It is a question about django that has found absolutely no answer for me. Let's suppose I have a site where I display two blocks in the sidebar :

  1. A list of the last users who've logged in
  2. A list of the last published blog articles

Let's say that these blocks are to be displayed on 80% of the website urls and presented using template files. The data for these blocks is generated by code (obviously), bt not by url views.

Well, how t开发者_C百科o do such a thing ?


You might want to take a look at custom template tags.

Edit: more specifically, look at inclusion template tags.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜