skip to navigation
skip to content

Not Logged In

django_mako_plus 2.0.4

Combines Django framework and Mako templating engine, plus a few bonuses.

Latest Version: 2.0.21

# Use This If You've Said:

  • Why are Django templates weak sauce? Why not just use regular Python in templates?
  • Why does Django make me list every. single. page. in
  • I'd like to include Python code in my CSS and Javascript files.
  • My app's file is getting HUGE. How can I split it intelligently?

# Hints

See the tutorial at the DMP home page:

# Description

This app is a front controller that integrates the excellent Django framework with the also excellent Mako templating engine. Django comes with its own template system, but it's fairly weak (by design). Mako, on the other hand, is a fantastic template system that allows full Python code within HTML pages. But the framework doesn't stop there (that's the "plus" part of the name). Django-Mako-Plus adds the following features:

  1. DMP uses the Mako templating engine rather than the weaker Django templating engine. Why would I want to learn a whole new language for templating when Mako uses my favorite language: Python?
  2. DMP allows calling views and html pages by convention rather than specific entries in Any .html file on your site can be called without new entries in for every. single. new. page. Doesn't Python favor convention over configuration?
  3. DMP introduces the idea of URL parameters. These allow you to embed parameters in urls, Django style (but without requiring definitions).
  4. DMP separates view functions into different files rather than all-in-one style. Anyone who has programmed Django long knows that the single file in each app often gets looooonnng. Splitting logic into separate files keeps things more orderly.
  5. DMP automatically includes CSS and JS files, and it allows Python code within these files. These static files get included in your web pages without any explicit declaration of <link> or <script> elements. Python code within these support files means your CSS can change based on user or database entries.

But don't worry, you'll still get all the Django goodness with its fantastic ORM, views, forms, etc.

> The primary reason Django doesn't allow full Python in its templates is the designers want to encourage you and I to keep template logic simple. I fully agree with this philosophy. I just don't agree with the "forced" part of this philosophy. The Python way is rather to give freedom to the developer but train in the correct way of doing things. Even though I fully like Python in my templates, I still keep them fairly simple. Views are where your logic goes.

File Type Py Version Uploaded on Size
django_mako_plus-2.0.4.tar.gz (md5) Source 2014-02-06 10KB
  • Downloads (All Versions):
  • 23 downloads in the last day
  • 499 downloads in the last week
  • 5650 downloads in the last month