Search code examples
pythondjangotemplatesweb-frameworkszope

Why web frameworks build pages from templates rather than logical blocks?


I am new to web frameworks. I always imagined that they'll be working as building a page from a logical blocks of the page (layout, header, menu, content, footer, etc.). Then they'll set up each logical block (content & look).

I had a brief look at following frameworks:

  • Django
  • Web2py
  • Zope
  • CherryPy

(I didn't make CubicWeb working.)

None of them seems to be working the way I imagined. Instead they rely on system of templates in whose I have to manually construct all trivial elements of a page.

Obviously there have to be some good reasons behind the proven way, but I don't see them.

Why the frameworks do not build pages from logical blocks? Is there some (python) framework which works the way I expected?


Solution

  • Your question describes a content management system rather than a webframework which are meant for much more than just rendering templates. E.g. you can use a webframework to build a cms that renders content types as blocks, although you would probably be wasting your time reinventing the wheel.

    An example of a block rendering CMS for Django, FeinCMS