<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" version="2.0">

<channel>
	<title>Active Frequency</title>
	
	<link>http://www.activefrequency.com/blog</link>
	<description>Web &amp; Mobile Development</description>
	<lastBuildDate>Sun, 15 Jan 2012 04:32:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/activefrequencyblog" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="activefrequencyblog" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Python Calling Javascript? A UI Pattern</title>
		<link>http://www.activefrequency.com/blog/2011/python-calling-javascript-a-ui-pattern/</link>
		<comments>http://www.activefrequency.com/blog/2011/python-calling-javascript-a-ui-pattern/#comments</comments>
		<pubDate>Thu, 22 Dec 2011 20:45:26 +0000</pubDate>
		<dc:creator>JohnO</dc:creator>
				<category><![CDATA[Django]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://www.activefrequency.com/blog/?p=493</guid>
		<description><![CDATA[We have been very busy (excuse us for the lack of posts!) working on a second version of a client project. It involves redoing the whole UI in a much more responsive manner. In times past the &#8220;simple&#8221; way I have done this, especially with Django on the backend, has been to have the server [...]]]></description>
			<content:encoded><![CDATA[<p>
We have been very busy (excuse us for the lack of posts!) working on a second version of a client project. It involves redoing the whole UI in a much more responsive manner. In times past the &#8220;simple&#8221; way I have done this, especially with Django on the backend, has been to have the server respond with HTML, and inject that into the DOM. There are some serious limitations with this approach once you get far enough down the road. And it gets very messy.
</p>
<p>
We decided on a whole different approach to a responsive application. We are serving up data. The javascript takes care of the rest. Often times a single action requires multiple reactions by the interface. Yet, if you&#8217;ve abstracted your code (be pythonic, even in javascript: D.R.Y!) you can&#8217;t jump into a specific call/response, or even if you could, it&#8217;d be awful to throw a switch statement in there. <a href="http://en.wikipedia.org/wiki/Command_pattern" target="_blank">The Command Pattern</a> to the rescue!
</p>
<p>
To be fair, what we&#8217;ve implemented is a very simple execution of the pattern. Let&#8217;s take the python-end first:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
</pre></td><td class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">class</span> CommandBuilder<span style="color: black;">&#40;</span><span style="color: #008000;">object</span><span style="color: black;">&#41;</span>:
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">def</span> <span style="color: #0000cd;">__init__</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>, <span style="color: #66cc66;">*</span>args, <span style="color: #66cc66;">**</span>kwargs<span style="color: black;">&#41;</span>:
        <span style="color: #008000;">super</span><span style="color: black;">&#40;</span>CommandBuilder, <span style="color: #008000;">self</span><span style="color: black;">&#41;</span>.<span style="color: #0000cd;">__init__</span><span style="color: black;">&#40;</span><span style="color: #66cc66;">*</span>args, <span style="color: #66cc66;">**</span>kwargs<span style="color: black;">&#41;</span>
        <span style="color: #008000;">self</span>.<span style="color: black;">data</span> = <span style="color: black;">&#91;</span><span style="color: black;">&#93;</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">def</span> raw_callback<span style="color: black;">&#40;</span><span style="color: #008000;">self</span>, callback, args<span style="color: black;">&#41;</span>:
        <span style="color: #008000;">self</span>.<span style="color: black;">data</span>.<span style="color: black;">append</span><span style="color: black;">&#40;</span><span style="color: black;">&#123;</span> <span style="color: #483d8b;">'callback'</span>: callback, <span style="color: #483d8b;">'args'</span>: args <span style="color: black;">&#125;</span><span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: #008000;">self</span>
&nbsp;
    @<span style="color: #008000;">property</span>
    <span style="color: #ff7700;font-weight:bold;">def</span> js<span style="color: black;">&#40;</span><span style="color: #008000;">self</span><span style="color: black;">&#41;</span>:
        <span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: #008000;">self</span>.<span style="color: black;">JavascriptMethods</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span><span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">def</span> dumps<span style="color: black;">&#40;</span><span style="color: #008000;">self</span><span style="color: black;">&#41;</span>:
        <span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: black;">&#123;</span> <span style="color: #483d8b;">'commands'</span>: <span style="color: #008000;">self</span>.<span style="color: black;">data</span> <span style="color: black;">&#125;</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">class</span> JavascriptMethods<span style="color: black;">&#40;</span><span style="color: #008000;">object</span><span style="color: black;">&#41;</span>:
&nbsp;
        <span style="color: #ff7700;font-weight:bold;">def</span> <span style="color: #0000cd;">__init__</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>, command<span style="color: black;">&#41;</span>:
            <span style="color: #008000;">self</span>.<span style="color: black;">command</span> = command
&nbsp;
        <span style="color: #ff7700;font-weight:bold;">def</span> a_function<span style="color: black;">&#40;</span><span style="color: #008000;">self</span>, a_model<span style="color: black;">&#41;</span>:
            <span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: #008000;">self</span>.<span style="color: black;">command</span>.<span style="color: black;">raw_callback</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'a_function'</span>, <span style="color: black;">&#91;</span> a_model.<span style="color: #008000;">id</span>, a_model.<span style="color: black;">name</span> <span style="color: black;">&#93;</span><span style="color: black;">&#41;</span></pre></td></tr></table></div>

<p>
Just for some syntactic-sugar I also used the <a href="http://rwhansen.blogspot.com/2007/07/theres-builder-pattern-that-joshua.html" target="_blank">builder pattern</a> and a python property which masks the Javascript Methods inner class. All that means you can write pretty code like this:
</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="python" style="font-family:monospace;">cmds = CommandBuilder.<span style="color: black;">js</span>.<span style="color: black;">a_function</span><span style="color: black;">&#40;</span>a_model<span style="color: black;">&#41;</span>.<span style="color: black;">a_function</span><span style="color: black;">&#40;</span>a_model<span style="color: black;">&#41;</span>.<span style="color: black;">a_function</span><span style="color: black;">&#40;</span>a_model<span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">return</span> HTTPResponse<span style="color: black;">&#40;</span>simplejson.<span style="color: black;">dumps</span><span style="color: black;">&#40;</span>cmds.<span style="color: black;">dumps</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span></pre></td></tr></table></div>

<p>In the real world you wouldn&#8217;t be calling the same javascript function over and over, you would expose the functions you need to call. And now we need a little bit of javascript to handle this known JSON data structure:
</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> Commander <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span>
    a_function<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>id<span style="color: #339933;">,</span> <span style="color: #000066;">name</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #000066;">name</span><span style="color: #339933;">+</span><span style="color: #3366CC;">&quot; has an id of: &quot;</span><span style="color: #339933;">+</span>id<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">var</span> Engine <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span>
    run_command<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>data<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>data <span style="color: #339933;">==</span> undefined <span style="color: #339933;">||</span> data.<span style="color: #660066;">command</span> <span style="color: #339933;">==</span> undefined <span style="color: #339933;">||</span> data.<span style="color: #660066;">command</span>.<span style="color: #660066;">length</span> <span style="color: #339933;">===</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'This is not a command structure'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i <span style="color: #000066; font-weight: bold;">in</span> data.<span style="color: #660066;">command</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #003366; font-weight: bold;">var</span> row <span style="color: #339933;">=</span> data.<span style="color: #660066;">command</span><span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
            <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">typeof</span> Commander<span style="color: #009900;">&#91;</span>row.<span style="color: #660066;">callback</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">===</span> <span style="color: #3366CC;">'function'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                 Commander<span style="color: #009900;">&#91;</span>row.<span style="color: #660066;">callback</span><span style="color: #009900;">&#93;</span>.<span style="color: #660066;">apply</span><span style="color: #009900;">&#40;</span>undefined<span style="color: #339933;">,</span> row.<span style="color: #660066;">args</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// undefined as this</span>
            <span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
                 <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Function '</span><span style="color: #339933;">+</span>row.<span style="color: #660066;">callback</span><span style="color: #339933;">+</span><span style="color: #3366CC;">' does not exist on Commander'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>
The javascript `apply` method is a lifesaver here. With this simple pattern we can have the server force client-side code to be executed. Now, if you&#8217;ve been a diligent developer you&#8217;ve already been naming your functions on the client-side, not just throwing around a million anonymous functions. And you&#8217;ve separated out the functions that deal with calling URLs or dealing with the DOM from those functions which deal with the data. There is a huge bonus with doing that (besides this pattern being useful for you): you can start <strong>testing</strong> your javascript!
</p>
<p>
<strong>Reflections:</strong></p>
<ul>
<li>I tend to think of the `.js` in python a namespace. You can specify a specific Javascript object on the front end with a few minor changes on both ends. My `CommandBuilder` object has a few more methods on it, so the `.js` serves as a semantic separator as well.</li>
<li>There is only one downside to this pattern that I have observed so far &#8211; if you make changes to function signatures in javascript, you&#8217;ll need to change the python side as well. You need to stay on your toes with this pattern.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.activefrequency.com/blog/2011/python-calling-javascript-a-ui-pattern/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting Started With Django – Slides</title>
		<link>http://www.activefrequency.com/blog/2011/getting-started-with-django-slides/</link>
		<comments>http://www.activefrequency.com/blog/2011/getting-started-with-django-slides/#comments</comments>
		<pubDate>Wed, 25 May 2011 15:16:39 +0000</pubDate>
		<dc:creator>Kevin Grinberg</dc:creator>
				<category><![CDATA[Django]]></category>

		<guid isPermaLink="false">http://www.activefrequency.com/blog/?p=476</guid>
		<description><![CDATA[Thanks to all those who made it out to last night&#8217;s &#8220;Getting Started With Django&#8221; meetup at Django Boston &#8211; it was great to see so many veterans and newcomers both. If you missed it, or want to review, check out the slides (for the curious, we&#8217;re using html5slides for the slide template &#8211; we [...]]]></description>
			<content:encoded><![CDATA[<p>Thanks to all those who made it out to last night&#8217;s &#8220;Getting Started With Django&#8221; meetup at <a href="http://www.meetup.com/djangoboston/">Django Boston</a> &#8211; it was great to see so many veterans and newcomers both.</p>
<p>If you missed it, or want to review, check out <a href="http://www.activefrequency.com/getting-started-with-django/slides/">the slides</a> (for the curious, we&#8217;re using <a href="http://code.google.com/p/html5slides/">html5slides</a> for the slide template &#8211; we saw it at Google I/O and fell in love.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.activefrequency.com/blog/2011/getting-started-with-django-slides/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Getting Started With Django</title>
		<link>http://www.activefrequency.com/blog/2011/getting-started-with-django/</link>
		<comments>http://www.activefrequency.com/blog/2011/getting-started-with-django/#comments</comments>
		<pubDate>Fri, 20 May 2011 18:51:14 +0000</pubDate>
		<dc:creator>Kevin Grinberg</dc:creator>
				<category><![CDATA[Django]]></category>

		<guid isPermaLink="false">http://www.activefrequency.com/blog/?p=470</guid>
		<description><![CDATA[We&#8217;re pleased to announce that this coming Tuesday, May 24th, we&#8217;ll be leading a &#8220;Getting Started with Django&#8221; session at the Django Boston Meetup. We&#8217;ll post our slides after the session, but definitely encourage everyone in the Boston area to come to the meetup!]]></description>
			<content:encoded><![CDATA[<p>We&#8217;re pleased to announce that this coming Tuesday, May 24th, we&#8217;ll be leading a <a href="http://www.meetup.com/djangoboston/events/16210200/">&#8220;Getting Started with Django&#8221;</a> session at the <a href="http://www.meetup.com/djangoboston/">Django Boston Meetup</a>.</p>
<p>We&#8217;ll post our slides after the session, but definitely encourage everyone in the Boston area to come to the meetup!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.activefrequency.com/blog/2011/getting-started-with-django/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google IO 2011</title>
		<link>http://www.activefrequency.com/blog/2011/google-io-2011/</link>
		<comments>http://www.activefrequency.com/blog/2011/google-io-2011/#comments</comments>
		<pubDate>Sun, 08 May 2011 22:53:18 +0000</pubDate>
		<dc:creator>JohnO</dc:creator>
				<category><![CDATA[android]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://www.activefrequency.com/blog/?p=464</guid>
		<description><![CDATA[This week Active Frequency is taking a field trip to San Francisco for Google I/O 2011! We&#8217;re psyched to immerse ourselves in all things Google for a few days; here are a couple of highlights we&#8217;re especially looking forward to: John Learning about ActivityFragments available in Honeycomb. These seem like an incredibly powerful way to [...]]]></description>
			<content:encoded><![CDATA[<p>This week Active Frequency is taking a field trip to San Francisco for <a href="http://www.google.com/events/io/2011/">Google I/O 2011</a>!</p>
<p>We&#8217;re psyched to immerse ourselves in all things Google for a few days; here are a couple of highlights we&#8217;re especially looking forward to:</p>
<p><b>John</b></p>
<ul>
<li> Learning about ActivityFragments available in Honeycomb. These seem like an incredibly powerful way to use and organize your mobile applications. To use a web concept &#8211; this has the potential to be the native &#8220;responsive design&#8221; to tablet/phone displays.</li>
<li> I am eager to see just how far Android can leverage NFC today. This isn&#8217;t something I&#8217;ve read very much about. The hardware/software rollout plan can be very much a chicken and egg problem, so I look forward to seeing Google&#8217;s plan.</li>
<li> And last, but not least, they have a specifically UI building focused talk, which excites me. The app I&#8217;ve been working on is mostly functional &#8211; but obviously ugly. I hope I get some ideas and inspiration here.</li>
</ul>
<p><b>Kevin</b></p>
<ul>
<li> &#8220;JavaScript Programming in the Large with Closure Tools&#8221; &#8211; JavaScript, a language with many critics but one of my personal favorites, has really come into its own of late.  As we write bigger and bigger JavaScript apps, though, we run into more and more problems associated with non-trivial systems &#8211; and tools like Closure help make JavaScript more of a &#8220;real&#8221; language than the &#8220;scripting&#8221; language it started out as.</li>
<li> &#8220;Writing Web Apps in Go&#8221; &#8211; I&#8217;ll be honest: I&#8217;m a bit skeptical about Go&#8217;s suitability for web apps.  But how can you not be curious about a language designed by such an <a href="http://en.wikipedia.org/wiki/Rob_Pike">all-star</a> <a href="http://en.wikipedia.org/wiki/Ken_Thompson">cast</a>?</li>
<li> &#8220;Map your business, inside and out&#8221; and &#8220;Location Based App development using Google APIs&#8221; &#8211; these two talks represent just some of the cool things going on with geolocation.</li>
</ul>
<p>We&#8217;ll be hanging around at I/O &#8211; if you&#8217;re there too, find us: <a href="http://twitter.com/activefrequency">@activefrequency</a>, <a href="http://twitter.com/kgrinberg">@kgrinberg</a>, <a href="http://twitter.com/jobelenus">@jobelenus</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.activefrequency.com/blog/2011/google-io-2011/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Looking Forward – Django 1.3</title>
		<link>http://www.activefrequency.com/blog/2011/looking-forward-django-1-3/</link>
		<comments>http://www.activefrequency.com/blog/2011/looking-forward-django-1-3/#comments</comments>
		<pubDate>Thu, 24 Mar 2011 17:36:33 +0000</pubDate>
		<dc:creator>JohnO</dc:creator>
				<category><![CDATA[Django]]></category>

		<guid isPermaLink="false">http://www.activefrequency.com/blog/?p=457</guid>
		<description><![CDATA[The next version (1.3) of Django was just announced, and there are tons of things we here at Active Frequency are very excited to see. Some of these are just plain awesome. And, some scratch itches we&#8217;ve had on some of our projects. But there are two warnings you need to pay attention to if [...]]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://docs.djangoproject.com/en/1.3/">next version (1.3) of Django</a> was just announced, and there are tons of things we here at Active Frequency are very excited to see. Some of these are just plain awesome. And, some scratch itches we&#8217;ve had on some of our projects.
</p>
<p>
But there are two warnings you need to pay attention to if you are considering going with 1.3; 1) <a href="http://docs.djangoproject.com/en/dev/releases/1.3/#csrf-validation-now-applies-to-ajax-requests">CSRF</a> is now required for all ajax calls, and there are some helpful code bits in there to make this an easy addition, and 2) 1.3 is the last version that will support python 2.4. Now let&#8217;s get on with the good stuff we are excited about:
</p>
<ul>
<li>Backend support for <a href="http://docs.djangoproject.com/en/1.3/topics/auth/#authorization-for-inactive-users">Inactive users</a> is going to be very helpful. There are some tricks, and I&#8217;ve done some of them, to create active users without proper usernames and passwords. Doing it that way is just strange, and this addition will provide the proper support for it.</li>
<li><a href="http://docs.djangoproject.com/en/dev/releases/1.3/#improvements-to-built-in-template-tags">Include and With</a> just got a lot more powerful in templates. This will allow you to create more modular and re-usable templates without worrying too much about template variables in your views.</li>
<li>In the department of awesome, <a href="http://docs.djangoproject.com/en/dev/releases/1.3/#templateresponse">responses</a> will now be available to decorators/middleware. I can think of a few places in our applications that would benefit by template switching located outside the view specifically.</li>
<li>This is the feature that most people have been waiting on &#8211; and on the dev mailing list, talking about &#8211; <a href="http://docs.djangoproject.com/en/dev/topics/class-based-views/">Class Based Views</a>. At first I wondered how much this would really change things, as the views I now write are very small and fairly boilerplate. However, in looking at the generic classes and examples they have I am excited to dig into this and have to write even less view code. With these kinds of developments all the stuff you hear about Javascript being the next language you must learn &#8211; they are right. More than half of the code I write these days is Javascript anyhow. Class-based views are only going to push development more in that direction.
</li>
<li>Two additions were made to i18n for helping translators in the new version (something we have <a href="http://www.activefrequency.com/blog/2011/more-i18n-code/">worked with it</a> <a href="http://www.activefrequency.com/blog/2011/deploying-django-translations-with-django-rosetta/">quite a bit</a>). First are <a href="http://docs.djangoproject.com/en/dev/topics/i18n/internationalization/#contextual-markers">Contextual Markers</a> so you can give more information about what the word actually denotes. And second, <a href="http://docs.djangoproject.com/en/dev/topics/i18n/internationalization/#translator-comments">comments</a> built right into python comments. I wish I had these already, as we&#8217;ve already been in discussing and trying to make schemes to help the translators know exactly what we&#8217;re trying to get across.</li>
</ul>
<p>The Django dev team is fantastic to get this much stuff out the door for version 1.3. You can see the whole <a href="http://docs.djangoproject.com/en/dev/releases/1.3/">changelog here</a>.  We here can only wait to see what they have in store for the future. And if you want to see what they&#8217;re working on for the future, sign up for the <a href="http://groups.google.com/group/django-developers">dev mailing list</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.activefrequency.com/blog/2011/looking-forward-django-1-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Organizational Skills</title>
		<link>http://www.activefrequency.com/blog/2011/organizational-skills/</link>
		<comments>http://www.activefrequency.com/blog/2011/organizational-skills/#comments</comments>
		<pubDate>Fri, 18 Mar 2011 13:52:59 +0000</pubDate>
		<dc:creator>JohnO</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.activefrequency.com/blog/?p=452</guid>
		<description><![CDATA[In one of my recent tweets I noted that I had been reading through Fredrick Brook&#8217;s The Mythical Man-Month again when the mind needs a break in the office. In between all of the dated, but fascinating, technology references there is plenty of gold to mine. One of the striking organizational skills he goes over [...]]]></description>
			<content:encoded><![CDATA[<p>
In one of <a href="http://twitter.com/#!/jobelenus/status/43709230380875776">my recent tweets</a> I noted that I had been reading through Fredrick Brook&#8217;s <a href="http://www.amazon.com/Mythical-Man-Month-Software-Engineering-Anniversary/dp/0201835959/ref=sr_1_1?ie=UTF8&#038;qid=1300395119&#038;sr=8-1"><i>The Mythical Man-Month</i></a> again when the mind needs a break in the office. In between all of the dated, but fascinating, technology references there is plenty of gold to mine.
</p>
<p>
One of the striking organizational skills he goes over is the construction of a programming team. I have worked in plenty of different small-medium sized organizations, but I have never been involved in a genuine single-project group-development effort. It has been a single programmer working in isolation. Or, at best, two programmers splitting a project down the middle with a static and defined interface (this tactic is also described in the book).
</p>
<p>
Only now am I working in an actual group where roles are given. Some of Brook&#8217;s roles are: tool-master, architect, and specialist, and program manager. Obviously I don&#8217;t need a batch tape scheduler anymore &#8211; but the above roles are very key. The program manager represents the client and user interests. The architect represents the sole owner of technical implementation decisions. Now, in all the other organizations I&#8217;ve been a part of, these roles undoubtedly exist. There might be two or more people competing or fulfilling these roles &#8211; but they exist. What I had not previously experience was the tool-master and specialist.
</p>
<p>
The tool-master is solely responsible for creating the tools necessary for the team to do their jobs. I&#8217;ve seen this manifest as; deploy scripts, local environment tools to mock out production infrastructure, and using and contributing to open source projects (we do not suffer from <abbr title="Not Invented Here">NIH</abbr> syndrom). Sometimes this person is me. Sometimes it is not. But the tool-master is always responsible for his tools and to keep them up to date, and to keep the team informed about how to use them. Without this last point members of the team are wasting time figuring something out that has already been done.
</p>
<p>
I have experienced the specialist to be one of the most invaluable assets to the architect. If the architect is responsible for the whole system and writing most of the code what happens when he or she hits a small thorny problem. Sometimes it is an incompatibility between two pieces of software, or server settings. But whatever it is, someone has to take the red pill and go down the rabbit hole. If your architect goes in, he&#8217;ll come out a couple of days later with the beginnings of a beard, and a solution, but features won&#8217;t have be written. It is crucial to have a specialist who can take these thorns that need fixing.
</p>
<p>
All in all the amazing discovery I am witnessing is the overall level of communication on a team that quickly figures out how to design, architect, and implement projects; figuring out the limitations and ways to solve and overcome them.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.activefrequency.com/blog/2011/organizational-skills/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>More i18n Code</title>
		<link>http://www.activefrequency.com/blog/2011/more-i18n-code/</link>
		<comments>http://www.activefrequency.com/blog/2011/more-i18n-code/#comments</comments>
		<pubDate>Thu, 03 Mar 2011 15:18:32 +0000</pubDate>
		<dc:creator>JohnO</dc:creator>
				<category><![CDATA[Django]]></category>

		<guid isPermaLink="false">http://www.activefrequency.com/blog/?p=447</guid>
		<description><![CDATA[If you have ever written a thoroughly internationalized project you know just how hard it can be. While Python and Django are fantastic in allowing internationalization in your applications, sometimes we still need a little more help. In the last post Kevin told showed us django-rosetta and a way to package and deploy the translation [...]]]></description>
			<content:encoded><![CDATA[<p>
If you have ever written a thoroughly internationalized project you know just how hard it can be. While Python and Django are <a href="http://www.djangoproject.com/documentation/i18n/">fantastic in allowing internationalization</a> in your applications, sometimes we still need a little more help.
</p>
<p>
In the <a href="http://www.activefrequency.com/blog/2011/deploying-django-translations-with-django-rosetta/">last post</a> Kevin told showed us <a href="http://code.google.com/p/django-rosetta/">django-rosetta</a> and a way to package and deploy the translation files. That is certainly one step. I have been a part of a team responsible for a PHP product with support for at least six languages. It got pretty hairy without a tool like django-rosetta and a sane deployment process.
</p>
<p>
In the Django world, the community is a huge resource &#8211; not just for advice and documentation, but also pluggable applications you can use in your projects. One of these we use pretty frequently is django-faq for creating an easy to update, index, and change FAQ system without a client writing tons of HTML. In case you think you are seeing a theme here, well, you are &#8211; we are working on an internationalized project. So we had another opportunity to contribute back to the community by <a href="https://github.com/jobelenus/django-faq" target="_blank">internationalizing the django-faq</a> app with the help of the already awesome <a href="https://github.com/ojii/django-multilingual-ng">multilingual-ng</a> app. All in all a very small tweak for us to do &#8211; but now with one more fully internationalized app in the tool belt, it&#8217;s easier to internationalize the next project. I hope it helps more than just us!
</p>
<p>
If you&#8217;ve never worked with multilingual-ng in models, I&#8217;ll give a quick run-through here with the Topic model (but you can see all the basic changes I made in <a href="https://github.com/jobelenus/django-faq/commit/7eacbd23cb820693103a6773e16015be32604180" target="_blank">this diff</a>).
</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">class</span> Topic<span style="color: black;">&#40;</span>models.<span style="color: black;">Model</span><span style="color: black;">&#41;</span>:
     <span style="color: #808080; font-style: italic;"># normally your name field would go here, but to make it translatable you do this</span>
     <span style="color: #ff7700;font-weight:bold;">class</span> Translation<span style="color: black;">&#40;</span>TranslationModel<span style="color: black;">&#41;</span>:
           name = models.<span style="color: black;">CharField</span><span style="color: black;">&#40;</span>max_length=<span style="color: #ff4500;">150</span><span style="color: black;">&#41;</span></pre></td></tr></table></div>

<p>
The rest of the work is magic. And there is an admin class built to handle the display and saving of this as well. It plugs right into the Django ORM. Beautiful!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.activefrequency.com/blog/2011/more-i18n-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Deploying Django translations with django-rosetta</title>
		<link>http://www.activefrequency.com/blog/2011/deploying-django-translations-with-django-rosetta/</link>
		<comments>http://www.activefrequency.com/blog/2011/deploying-django-translations-with-django-rosetta/#comments</comments>
		<pubDate>Fri, 25 Feb 2011 18:00:07 +0000</pubDate>
		<dc:creator>Kevin Grinberg</dc:creator>
				<category><![CDATA[Django]]></category>

		<guid isPermaLink="false">http://www.activefrequency.com/blog/?p=443</guid>
		<description><![CDATA[One of Django&#8217;s big strengths is excellent support for internationalization (&#8220;i18n&#8221;). The built-in tooling is great for creating message files to send to translators, and then deploying them with the application. However, what if you need a quick admin-like way to tweak a translation? Enter django-rosetta, an excellent helper tool that gives you an admin-like [...]]]></description>
			<content:encoded><![CDATA[<p>One of Django&#8217;s big strengths is <a href="http://www.djangoproject.com/documentation/i18n/">excellent support for internationalization</a> (&#8220;i18n&#8221;).</p>
<p>The built-in tooling is great for creating message files to send to translators, and then deploying them with the application.  However, what if you need a quick admin-like way to tweak a translation?  Enter <a href="http://code.google.com/p/django-rosetta/">django-rosetta</a>, an excellent helper tool that gives you an admin-like interface to your translations (.po/.mo files).</p>
<p>The one problem with django-rosetta is how it fits (or doesn&#8217;t fit) into our standard deployment workflow.  We use git for source control, and the basic assumption is that we can deploy a build from master at any time.</p>
<p>The problem with that is that on the one hand, the locale message files (translations) clearly need to live with the source; on the other hand, translators making changes via django-rosetta aren&#8217;t in a position to learn git and commit their changes back.</p>
<p>The solution we&#8217;ve started using is two-fold:</p>
<p>1) Keep the translations in a separate repository, symlinked from the main repo for convenience.</p>
<p>2) Before running &#8220;makemessages&#8221; (which updates the message files with any changes from the application), we commit and push any changes the translators have made on the server using rosetta, then pull them locally (we use <a href="http://www.fabfile.org/">Fabric</a> for deployments, so we just made a fab command for this).</p>
<p>Note that any changes should still go through the normal translation/release cycle, since you&#8217;ll generally want to update any translations before releasing the update!  But at least this way, translators can make minor changes on the fly without you losing the benefits of DVCS.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.activefrequency.com/blog/2011/deploying-django-translations-with-django-rosetta/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TemplateTags Can Save Your Life</title>
		<link>http://www.activefrequency.com/blog/2011/templatetags-can-save-your-life/</link>
		<comments>http://www.activefrequency.com/blog/2011/templatetags-can-save-your-life/#comments</comments>
		<pubDate>Thu, 17 Feb 2011 15:44:11 +0000</pubDate>
		<dc:creator>JohnO</dc:creator>
				<category><![CDATA[Django]]></category>

		<guid isPermaLink="false">http://www.activefrequency.com/blog/?p=424</guid>
		<description><![CDATA[I have had the mis^H^H^Hgood-fortune of writing data reports for customers. Lots of reports. For lots of customers. With lots of different features. In a few different languages now. Django makes this pretty simple for 90% of the cases with its ORM layer (I did have to drop into SQL once, LEFT JOINS are the [...]]]></description>
			<content:encoded><![CDATA[<p>I have had the mis^H^H^H<i>good</i>-fortune of writing data reports for customers. Lots of reports. For lots of customers. With lots of different features. In a few different languages now. Django makes this pretty simple for 90% of the cases with its ORM layer (I did have to drop into SQL once, LEFT JOINS are the debil). All the &#8220;standard&#8221; plugins (e.g. regrouper, django-pagination) love to work with QuerySets straight from the ORM layer. My heart warms in these winter months when I realize I will never, ever, write pagination code again.</p>
<p>There is a small glitch, however. How can I keep everything in the QuerySet so all the magic continues to work <em>while</em> performing the per-line, and total calculations that all clients absolutely need to see for their business?  One <i>could</i> place these calculations squarely on the model the QuerySet returns &#8211; if they are simple enough. But if you have numbers coming from related objects, are calculating multiple objects in one line, or how many Starbucks there can possibly be in Cambridge, (you get the idea) it gets messy quick. All this still doesn&#8217;t solve the inevitable total row the client demands! You end up with functions on ten different models, and you can&#8217;t see them on one code-screen. The code that crunches the numbers is quite far away from the template calling it. I don&#8217;t know about you, but I forget why I was looking for something when need to grep the models.py for ten minutes to find it.</p>
<p>I am choosing a simple example of an imaginary Customer Report showing all the items they&#8217;ve ordered to explain the concept in code, rather than through every bullet-point of my description above. Once you get the concept I think you&#8217;ll see how flexible it is and how powerful it can be.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;table&gt;
    &lt;tr&gt;
        &lt;th&gt;First&lt;/th&gt;
        &lt;th&gt;Last&lt;/th&gt;
        &lt;th&gt;Product&lt;/th&gt;
        &lt;th&gt;Order #&lt;/th&gt;
        &lt;th&gt;Revenue&lt;/th&gt;
        &lt;th&gt;Insurance Revenue&lt;/th&gt;
    &lt;/tr&gt;
    {% for customer in customers %}
    {% for order in customer.customer_rental_order.all %}
    {% for order_item in order.order_items.all %}
    &lt;tr class=&quot;{% cycle 'even' 'odd' %}&quot;&gt;
        &lt;td&gt;{{ customer.first_name }}&lt;/td&gt;
        &lt;td&gt;{{ customer.last_name }}&lt;/td&gt;
        &lt;td&gt;{{ order_item.product.name }}&lt;/td&gt;
        &lt;td class=&quot;numeric&quot;&gt;{{ order.pk }}&lt;/td&gt;
        &lt;td class=&quot;numeric&quot;&gt;{{ order_item.amount }}&lt;/td&gt;
        &lt;td class=&quot;numeric&quot;&gt;{{ order_item.insurance_amt }}&lt;/td&gt;
    &lt;/tr&gt;
    {% endfor %}
    {% empty %}
    &lt;tr&gt;
        &lt;td&gt;{{ customer.first_name }}&lt;/td&gt;
        &lt;td&gt;{{ customer.last_name }}&lt;/td&gt;
        &lt;td colspan=&quot;4&quot;&gt;&lt;i&gt;None&lt;/i&gt;&lt;/td&gt;
    &lt;/tr&gt;
    {% endfor %}
    &lt;tr&gt;
        &lt;th colspan=&quot;4&quot;&gt;&lt;/th&gt;
        &lt;th&gt;&lt;!-- How to get the total Revenue ? --&gt;&lt;/th&gt;
        &lt;th&gt;&lt;!-- How to get the total Insurance Revenue ? --&gt;&lt;/th&gt;
    &lt;/tr&gt;
    {% endfor %}
&lt;/table&gt;</pre></td></tr></table></div>

<p>This is where template tags have saved my life. I decided to make some template tags to do the totaling work for me. The total rows are pain because of all the related managers in the way. I needed something abstracted that I could reuse over and over. I wish I could have written this:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;tr&gt;
   &lt;th colspan=&quot;7&quot;&gt;&lt;/th&gt;
   &lt;th&gt;{{ customer.customer_rental_order.all.order_items.amount }}&lt;/th&gt;
   &lt;th&gt;{{ customer.customer_rental_order.all.order_items.insurance_amount }}&lt;/th&gt;
&lt;/tr&gt;</pre></td></tr></table></div>

<p>And have the template magically know to sum everything. In my dreams. Instead I cooked up a template tag I call `related`:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">    &lt;tr&gt;
        &lt;th colspan=&quot;7&quot;&gt;&lt;/th&gt;
        &lt;th&gt;{{ customer|related:&quot;customer_rental_order&quot;|related:&quot;order_items&quot;|tsum:&quot;amount&quot; }}&lt;/th&gt;
        &lt;th&gt;{{ customer|related:&quot;customer_rental_order&quot;|related:&quot;order_items&quot;|tsum:&quot;insurance_amt&quot; }}&lt;/th&gt;
    &lt;/tr&gt;</pre></td></tr></table></div>

<p>And this is how it works:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
</pre></td><td class="code"><pre class="python" style="font-family:monospace;">@register.<span style="color: #008000;">filter</span>
<span style="color: #ff7700;font-weight:bold;">def</span> related<span style="color: black;">&#40;</span>value, arg<span style="color: black;">&#41;</span>:
    <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #008000;">isinstance</span><span style="color: black;">&#40;</span>value, QuerySet<span style="color: black;">&#41;</span> <span style="color: #ff7700;font-weight:bold;">or</span> <span style="color: #008000;">type</span><span style="color: black;">&#40;</span>value<span style="color: black;">&#41;</span> == <span style="color: #008000;">type</span><span style="color: black;">&#40;</span><span style="color: black;">&#91;</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>:
        vals = <span style="color: black;">&#91;</span><span style="color: black;">&#93;</span>
        <span style="color: #ff7700;font-weight:bold;">for</span> v <span style="color: #ff7700;font-weight:bold;">in</span> value:
            <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #008000;">hasattr</span><span style="color: black;">&#40;</span>v, arg<span style="color: black;">&#41;</span>:
                <span style="color: #ff7700;font-weight:bold;">try</span>:
                    <span style="color: #ff7700;font-weight:bold;">for</span> item <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #008000;">getattr</span><span style="color: black;">&#40;</span>v, arg<span style="color: black;">&#41;</span>.<span style="color: #008000;">all</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:
                        vals.<span style="color: black;">append</span><span style="color: black;">&#40;</span>item<span style="color: black;">&#41;</span>
                <span style="color: #ff7700;font-weight:bold;">except</span> <span style="color: #008000;">AttributeError</span> <span style="color: #ff7700;font-weight:bold;">as</span> e: <span style="color: #808080; font-style: italic;"># arg has no all()</span>
                    vals.<span style="color: black;">append</span><span style="color: black;">&#40;</span><span style="color: #008000;">getattr</span><span style="color: black;">&#40;</span>v, arg<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">return</span> vals
    <span style="color: #ff7700;font-weight:bold;">elif</span> <span style="color: #008000;">hasattr</span><span style="color: black;">&#40;</span>value, arg<span style="color: black;">&#41;</span>:
        <span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: #008000;">getattr</span><span style="color: black;">&#40;</span>value, arg<span style="color: black;">&#41;</span>.<span style="color: #008000;">all</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></pre></td></tr></table></div>

<p>In a nutshell, `related` traverses the related managers for you. It takes a queryset, finds the related manager you&#8217;ve named, runs all(), and returns that list. When you chain it, next time it passes a list, it iterates the list, looking for the next related manager you&#8217;ve named in each one, and groups them all into a single list. If there is no `all` method to run, it just runs getattr. It always returns a list full of the &#8220;leaf&#8221; objects you wanted to get. You&#8217;ll also notice a `tsum` in there (short for &#8220;template_sum&#8221;) which works like so:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
</pre></td><td class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">def</span> cleannum<span style="color: black;">&#40;</span>num<span style="color: black;">&#41;</span>:
    <span style="color: #ff7700;font-weight:bold;">return</span> num <span style="color: #ff7700;font-weight:bold;">if</span> num <span style="color: #ff7700;font-weight:bold;">else</span> <span style="color: #ff4500;">0</span>
&nbsp;
@register.<span style="color: #008000;">filter</span>
<span style="color: #808080; font-style: italic;">#tsum for template sum, sum is a built-in</span>
<span style="color: #ff7700;font-weight:bold;">def</span> tsum<span style="color: black;">&#40;</span>value, arg<span style="color: black;">&#41;</span>:
    <span style="color: #ff7700;font-weight:bold;">try</span>:
        <span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: #008000;">sum</span><span style="color: black;">&#40;</span><span style="color: black;">&#91;</span>cleannum<span style="color: black;">&#40;</span>v<span style="color: black;">&#91;</span>arg<span style="color: black;">&#93;</span><span style="color: black;">&#41;</span> <span style="color: #ff7700;font-weight:bold;">for</span> v <span style="color: #ff7700;font-weight:bold;">in</span> value<span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">except</span> <span style="color: #008000;">TypeError</span> <span style="color: #ff7700;font-weight:bold;">as</span> e: <span style="color: #808080; font-style: italic;">#means that v is an object</span>
        <span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: #008000;">sum</span><span style="color: black;">&#40;</span><span style="color: black;">&#91;</span>cleannum<span style="color: black;">&#40;</span>v.<span style="color: #0000cd;">__dict__</span><span style="color: black;">&#91;</span>arg<span style="color: black;">&#93;</span><span style="color: black;">&#41;</span> <span style="color: #ff7700;font-weight:bold;">for</span> v <span style="color: #ff7700;font-weight:bold;">in</span> value<span style="color: black;">&#93;</span><span style="color: black;">&#41;</span></pre></td></tr></table></div>

<p>I had being using `tsum` in other reports, and the fact that `related` always returned a list meant this template tag *just worked*. I love this template tag technique for three reasons:</p>
<ol>
<li>All the django template bits like pagination and regrouper which expect iterables/querysets still work. The ORM is still doing the heavy lifting.</li>
<li>The template actually shows what is being calculated rather than jumping around in models.py through several models.</li>
<li>It is highly abstracted and can work on any object in your application. You don&#8217;t need to write similar gathering functions on different models.</li>
</ol>
<p>If you are ever writing reports (and I sincerely hope you are not) I hope this helps you overcome some pitfalls!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.activefrequency.com/blog/2011/templatetags-can-save-your-life/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>We support plumbing… and you should too!</title>
		<link>http://www.activefrequency.com/blog/2011/we-support-plumbing-and-you-should-too/</link>
		<comments>http://www.activefrequency.com/blog/2011/we-support-plumbing-and-you-should-too/#comments</comments>
		<pubDate>Thu, 10 Feb 2011 16:17:29 +0000</pubDate>
		<dc:creator>Kevin Grinberg</dc:creator>
				<category><![CDATA[Django]]></category>

		<guid isPermaLink="false">http://www.activefrequency.com/blog/?p=419</guid>
		<description><![CDATA[Any non-trivial web site these days stands on dozens of technologies &#8211; many of them open source, and some better known than others. Here at Active Frequency we try to contribute back to the community by releasing our own open-source code, and &#8211; starting today &#8211; making direct financial contributions to projects we think are [...]]]></description>
			<content:encoded><![CDATA[<p>Any non-trivial web site these days stands on dozens of technologies &#8211; many of them open source, and some better known than others.</p>
<p>Here at Active Frequency we try to contribute back to the community by releasing our own <a href="http://www.activefrequency.com/blog/2011/jquery-plugins-column-view-part-1/">open-source code</a>, and &#8211; starting today &#8211; making direct financial contributions to projects we think are particularly valuable and under-recognized.</p>
<p>The first recipient of our largesse is <a href="http://code.google.com/p/modwsgi/">mod_wsgi</a> &#8211; a critical part of our Django deployment stack.  This morning we donated $167.29 to Graham Dumpleton, the sole author of mod_wsgi (the funny amount is because we actually purchased a bunch of items from his <a href="http://www.amazon.com/gp/registry/wishlist/1ENAXIJG1G044/ref=wl_web/">Amazon wish list</a>, as requested in mod_wsgi&#8217;s <a href="http://code.google.com/p/modwsgi/wiki/HowToContributeBack">How To Contribute Back</a> page).</p>
<p>So, what does mod_wsgi do, and why is it important?  In the author&#8217;s own words:</p>
<blockquote><p>The aim of mod_wsgi is to implement a simple to use Apache module which can host any Python application which supports the Python WSGI interface.</p></blockquote>
<p>Essentially, mod_wsgi is the layer between the web server (Apache) and the application code (Python/Django), helping one &#8220;talk to&#8221; the other, and handling many of the details of HTTP transport.  To be precise, mod_wsgi is the leading implementation of the WSGI standard, which is the Python-world equivalent to the CGI standard that people who did web programming circa 1996 will likely remember.  James Bennett has <a href="http://www.b-list.org/weblog/2009/aug/10/wsgi/">an excellent (albeit slightly dated) write-up</a> that indirectly delves into the details of what the various WSGI implementations actually do (by way of outlining his issues with the WSGI standard).</p>
<p>Tools like mod_wsgi aren&#8217;t sexy &#8211; they&#8217;re not something that consumers typically hear about (how often do you see a &#8220;powered by mod_wsgi&#8221; badge on a web site?)  But they&#8217;re vital pieces of &#8220;plumbing&#8221; for the Django deployment stack, and we&#8217;re proud to support them.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.activefrequency.com/blog/2011/we-support-plumbing-and-you-should-too/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
	</channel>
</rss>

