Some parts of Django template are kinda widgets1, which are implemented using template tags and there could be a lot of some of them at the page (depending on session cookies for example)
Approach like this will do if their number is limited:
{% extends "some.html" %}
{% load mywidgets %}
{% block widgets %}
{% if widget1 %} {% widget1 %} {% endif %}
{% if widget2 %} {% widget2 %} {% endif %}
...
{% if widgetn %} {% widgetn %} {% endif %}
{% endblock widgets %}
But what if it’s not? How to handle a huge amount of widgets?
1 You can see what I mean at iGoogle 😉
I think that these widgets should be some kind of objects, not template tags. Objects that can render them self. Then you can simply store these objects in list and render them in a cycle.
In view you would initialize those objects by passing
requestor other required arguments. Widget object would implement__unicode__method which will render it. Then in template you would render it:{{ widget }}.Your widgets could even be django models. Then you could store settings and relate them to users.
You might want to check how fein-cms, django-cms implement content placeholders. Any kind of content objects can be associated to placeholder. Content object can render it self, and placeholder just renders collection of them.