lovelive
lovelive

Reputation: 35

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 to do such a thing ?

Upvotes: 2

Views: 1936

Answers (1)

André Caron
André Caron

Reputation: 45224

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

Edit: more specifically, look at inclusion template tags.

Upvotes: 3

Related Questions