Posts Tagged ‘frameworks’

Python Templating

November 10th, 2008

I’ve spotted two mentions of Python templates on a well known RSS lately so thought I’d throw together a quick intor of the major ones – partly for me to keep track but I thought I’d help the Pythonistas out too.

So here goes…

Mako

This is the replacement for the Myghty template system and is a bit different to all the others – I just don’t like it. In fact it looks plain awful but I guess some people love it. One thing it does have though is speed and in this group it comes a close second to Tenjin featured later on.

<%inherit file="base.html"/>
<%
    rows = [[v for v in range(0,10)] for row in range(0,10)]
%>

    % for row in rows:
        ${makerow(row)}
    % endfor
<%def name="makerow(row)"%> % for name in row: ${name} \ % endfor

Jinja

The winner of the nicest looking site goes to Jinja! Minimal and Japanese-y which is always good in my eyes. They have two versions available – you’ll want version 2. Its shiny. Oh!! I almost forgot to mention they happen to use the best source control system: Mercurial. All the cool kids use Mercurial.

Example:


My Webpage

{{ a_variable }

As you can see its very similar to Django, which is up next…

Django

The framework has a great templating language built into that is so good that Google made it the default in their Google App Engine platform. Although it mixes logic into the engine its quite conservative compared to many others. Its one of my favourites! Though that’s likely down to me using Django exclusively for anything Python web-related. So don’t take my word for it – take Google’s!!

Archive for {{ year }}

{% for date in days %} {% ifchanged %}

{{ date|date:"F" }}

{% endifchanged %} {{ date|date:"j" }} {% endfor %}

Cheetah

If you type “Python Templates” into Google then Cheetah features heavily.

So does a page on the Python site that lists all the Python template engines. Therefore making my post pointless and forcing me to dream up something special to make it worthwhile!

Anyway, back to Cheetah. The entire world uses it pretty much. Or at least Reddit does and some other unknown companies. But it’s a good one – not the fastest which will be a bit of a shock considering the name but hey: The worlds a whacky place to be.


#for $client in $clients


#end for
$client.surname, $client.firstname $client.email

Tenjin

Now this is the one deserving of the fast name as its the fastest engine here according to (their) benchmarks. Its also available for multiple languages and keeps its speed across them all. Take a look.

#{i} ${item}

Django Found’s….

June 17th, 2008

A Django site.A Foundation!!

Putting aside my grammatically dodgy statement the Django Project (the b3zt framework evaz!) has created the Django Foundation.  A non-profit organisation in the same vein as Mozilla, Apache, etc it aims to oversee the development, direction and future of the Django project.

You can find out more about the groups goals at the Foundation page on Django Project.

Lots of warm fuzzy snuggles to the community too:

We certainly couldn’t have gotten here without the amazing support and contributions from our community of users and developers. To everyone who’s used or contributed to Django: thanks!


Through testking you can be sure that the 350-001 you wrote was worth something, and you gained something by skipping 640-802. This also leads one to a faster VCP-310.

6 Ajax Frameworks in Seconds

April 8th, 2008

JavascriptLets skip the big comparisons here and get to brass tacks. Here’s the rapid review of Ajax frameworks:

  • YUI -Stable and comprehensive but a little verbose.
  • jQuery – Clean, fresh and perky but plenty of hacked, cruddy plugins to be wary of.
  • Ext – Beautiful to look at but agonising to use.
  • Prototype/Scriptaculous – Only popular because its used by Rails and CakePHP, but you can do better with jQuery.
  • Dojo – Meh.
  • MooTools – Trying to be like Prototype, little realising its picked thewrong one to copy.