<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	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/"
	>

<channel>
	<title>uxebu » blog &#187; django</title>
	<atom:link href="http://uxebu.com/category/django/feed/" rel="self" type="application/rss+xml" />
	<link>http://uxebu.com/blog</link>
	<description></description>
	<lastBuildDate>Thu, 19 Jan 2012 14:53:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>BarCamp Cologne</title>
		<link>http://uxebu.com/blog/2009/06/09/barcamp-cologne/</link>
		<comments>http://uxebu.com/blog/2009/06/09/barcamp-cologne/#comments</comments>
		<pubDate>Tue, 09 Jun 2009 15:52:10 +0000</pubDate>
		<dc:creator>tobias</dc:creator>
				<category><![CDATA[django]]></category>
		<category><![CDATA[dojango]]></category>
		<category><![CDATA[dojo]]></category>
		<category><![CDATA[event]]></category>

		<guid isPermaLink="false">http://blog.uxebu.com/?p=482</guid>
		<description><![CDATA[At the weekend (06/06/09 and 07/06/09) I&#8217;ve attended the BarCamp in Cologne. The event was completely overbooked just within some hours after the registration page was opened and I&#8217;m glad that I&#8217;ve got the possibility to attend there. A hint for people who try to attend to an overbooked event: just go there and ask [...]]]></description>
			<content:encoded><![CDATA[<p>At the weekend (06/06/09 and 07/06/09) I&#8217;ve attended the <a href="http://barcampcologne.mixxt.de/">BarCamp in Cologne</a>. The event was completely overbooked just within some hours after the registration page was opened and I&#8217;m glad that I&#8217;ve got the possibility to attend there. A hint for people who try to attend to an overbooked event: just go there and ask on site to get in. Normally they don&#8217;t say no.<br />
<span id="more-482"></span></p>
<p>On saturday I gave a little session there about the JavaScript Framework <a href="http://dojotoolkit.org">Dojo</a> and the server-side web framework <a href="http://www.djangoproject.com/">Django</a> and how you can use <a href="http://dojango.org">Dojango</a> to combine those two worlds. In the session I&#8217;ve showed some basic slides that were followed by a simple coding example. The people, who attended my session, were more interested in Dojo instead of Django, because they already knew a lot of Django. After doing my 30 minutes for the session I had to answer Dojo questions for another half an hour. Next time I definitely will do a Dojo session upfront :-)</p>
<div style="width:425px;text-align:left" class="mhx" id="__ss_1554458"><a style="font:14px Helvetica,Arial,Sans-serif;display:block;margin:12px 0 3px 0;text-decoration:underline;" href="http://www.slideshare.net/klipstein/dojango?type=presentation" title="Dojango">Dojango</a><object style="margin:0px" width="425" height="355"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=dojango-090609101601-phpapp01&#038;stripped_title=dojango" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=dojango-090609101601-phpapp01&#038;stripped_title=dojango" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object>
<div style="font-size:11px;font-family:tahoma,arial;height:26px;padding-top:2px;">View more <a style="text-decoration:underline;" href="http://www.slideshare.net/">PDF documents</a> from <a style="text-decoration:underline;" href="http://www.slideshare.net/klipstein">klipstein</a>.</div>
</div>
<p>Thanks to the organizers and sponsors for having such a nice event in Cologne. Can&#8217;t wait for attending the next BarCamp there.</p>
]]></content:encoded>
			<wfw:commentRss>http://uxebu.com/blog/2009/06/09/barcamp-cologne/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jj: dojo.beer(3) wrap up</title>
		<link>http://uxebu.com/blog/2009/05/11/jj-dojobeer3-wrap-up/</link>
		<comments>http://uxebu.com/blog/2009/05/11/jj-dojobeer3-wrap-up/#comments</comments>
		<pubDate>Mon, 11 May 2009 08:27:08 +0000</pubDate>
		<dc:creator>wolfram</dc:creator>
				<category><![CDATA[django]]></category>
		<category><![CDATA[dojango]]></category>
		<category><![CDATA[dojo]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[Tumbles]]></category>
		<category><![CDATA[uxebu]]></category>

		<guid isPermaLink="false">http://blog.uxebu.com/?p=386</guid>
		<description><![CDATA[jj: dojo.beer(3) wrap up]]></description>
			<content:encoded><![CDATA[<p><a href="http://jjkress.tumblr.com/post/105943227/dojo-beer-3-wrap-up">jj: dojo.beer(3) wrap up</a></p>
]]></content:encoded>
			<wfw:commentRss>http://uxebu.com/blog/2009/05/11/jj-dojobeer3-wrap-up/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>dojo.beer in Amsterdam and Munich</title>
		<link>http://uxebu.com/blog/2009/04/22/dojobeer-in-amsterdam-and-munich/</link>
		<comments>http://uxebu.com/blog/2009/04/22/dojobeer-in-amsterdam-and-munich/#comments</comments>
		<pubDate>Wed, 22 Apr 2009 13:20:34 +0000</pubDate>
		<dc:creator>wolfram</dc:creator>
				<category><![CDATA[django]]></category>
		<category><![CDATA[dojango]]></category>
		<category><![CDATA[dojo]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[uxebu]]></category>

		<guid isPermaLink="false">http://blog.uxebu.com/?p=317</guid>
		<description><![CDATA[Some of the dojo guys are traveling around the world, and we are happy to get Pete Higgins, Dylan Schiemann and Nikolai Onken together for a couple of dojo.beers. 1) Amsterdam, 27th April, 19:00 &#8211; the first one will be already next week in Amsterdam on Monday the 27th April, this will be a meetup [...]]]></description>
			<content:encoded><![CDATA[<p>Some of the dojo guys are traveling around the world, and we are happy to get <a href="http://higginsforpresident.net/">Pete Higgins</a>, <a href="http://dylanschiemann.com/">Dylan Schiemann</a> and Nikolai Onken together for a couple of dojo.beers.</p>
<p><strong>1) Amsterdam, 27th April, 19:00</strong> &#8211; the first one will be already <a href="http://dojocampus.org/content/2009/04/22/dojobeer-amsterdam-munich/">next week in Amsterdam</a> on Monday the 27th April, this will be a meetup in a restaurant and probably a lot of tech and geek talk and some beer.</p>
<p><strong>2) Munich, 9th May, all day</strong> &#8211; the second one will be a <a href="http://dojo.beer.mixxt.de/networks/wiki/index.dojo_beer_3">free full-day event in Munich</a> with talks and time to hang out and hack together. It will take place on the 9th May, starting at around 12:00 in the rooms of the <a href="http://skytecag.com/">SKYTEC AG</a> (<a href="http://maps.google.de/maps?q=Germany%2C+Oberhaching%2C+82041%2C+Keltenring+11%2C+SKYTEC+AG&#038;sll=48.002295,11.576005">Keltenring 11, 82041 Oberhaching</a>).<br />
<span id="more-317"></span></p>
<h2>Amsterdam, 27th April</h2>
<p><a href="http://dojocampus.org/content/2009/04/22/dojobeer-amsterdam-munich/">Detailed information</a><br />
All the following info are <a href="http://dojocampus.org/content/2009/04/22/dojobeer-amsterdam-munich/">from the dojocampus.org post</a>.</p>
<blockquote><p>
The first dojo.beer() in The Netherlands will be held on April 27th in Amsterdam. Hopefully this will be the beginning of a series of fun Dojo events bringing people from The Netherlands and around together, who work with Dojo, enjoy using Dojo and like everything around the Web.</p>
<p>As a special guest we will have both Dylan Schiemann (SitePen, Dojo Co-Founder) and Peter Higgins (Dojo Project Lead &#8211; aka phiggins), so if you want to meet the gurus of Dojo, make sure you will be there.</p>
<p>Location and more details will follow shortly.</p></blockquote>
<h2>Munich, 9th May</h2>
<p><a href="http://dojo.beer.mixxt.de/networks/wiki/index.dojo_beer_3">Detailed information</a><br />
After the very well received <a href="http://blog.thinkphp.de/archives/388-DOJO.WINE.html">dojo.wine in W&uuml;rzburg</a> with 37 attendees we hope we can do even better and will fly in Pete and Dylan to join us (so we don&#8217;t have to video-conference them in anymore). We are happy to have the Skytec AG sponsoring the location.</p>
<p>There are some really interesting topics planned, that are not only interesting for the dojo people but also for other JavaScript developers and developers of complementary technologies, such as django, comet(d), etc.</p>
<ul>
<li><a href="http://dojango.org">dojango</a> &#8211; dojo and django integration made easy</li>
<li><a href="http://code.google.com/p/xray-project/">xray</a> &#8211; a JavaScript+browser performance and analyzing tool</li>
<li>EventList &#8211; a google calendar, yahoo pipes mashup</li>
<li><a href="http://www.sitepen.com/blog/2009/04/01/stocker-advanced-dojo-made-easy/">Stocker</a> &#8211; SitePen&#8217;s cometd based chart and grid application</li>
<li><a href="http://code.google.com/p/plugd/">plugd</a> &#8211; a collection of useful functionality built on and around Base dojo.js</li>
</ul>
<p>If any of this catches your eye we will be happy to see you there. Please add yourself to <a href="http://dojo.beer.mixxt.de/networks/wiki/index.dojo_beer_3">the event wiki page</a> so we can better plan and prepare the event. Also if you have a talk you would like to give or there are topics that you are potentially interested in, please fill it in the wiki.<br />
And of course we will have T-Shirts, stickers, food, drinks and so on. We are looking forward to seeing you there.</p>
<h2>Professional Training, 8th May</h2>
<p>If you or your employees need a packed dose of professional dojo training, you can still signup for the <a href="http://blog.uxebu.com/2009/04/20/update-uxebu-sitepen-dojo-training-in-europe-may-8th/">uxebu &#038; SitePen &#8211; Dojo training in Europe</a>. This training takes place in the same location as the dojo.beer, just the day before, on the 8th May.<br />
This one day course on Dojo Data, Grids, Charts, and Comet is a very practical, hands-on, applied usage of Dojo to create a simple data visualization web application that takes advantage of advanced features of the Dojo Toolkit.</p>
]]></content:encoded>
			<wfw:commentRss>http://uxebu.com/blog/2009/04/22/dojobeer-in-amsterdam-and-munich/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Django/Dojo Stammtisch in Berlin</title>
		<link>http://uxebu.com/blog/2009/04/06/djangodojo-stammtisch-in-berlin/</link>
		<comments>http://uxebu.com/blog/2009/04/06/djangodojo-stammtisch-in-berlin/#comments</comments>
		<pubDate>Mon, 06 Apr 2009 16:38:34 +0000</pubDate>
		<dc:creator>wolfram</dc:creator>
				<category><![CDATA[django]]></category>
		<category><![CDATA[dojango]]></category>
		<category><![CDATA[dojo]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://blog.uxebu.com/?p=197</guid>
		<description><![CDATA[For the second time Django enthusiasts are meeting in Berlin on Wednesday, the 15th April, 2009 at 19:30. Find all the details here. And since I will be in Berlin this time, I just simply redeclare this to &#8220;Django/Dojo Stammtisch&#8221; instead of just &#8220;Django Stammtisch&#8221; :-). I hope all the djangoers are ok with that [...]]]></description>
			<content:encoded><![CDATA[<p>For the second time Django enthusiasts are meeting in Berlin on Wednesday, the 15th April, 2009 at 19:30. <a href="http://www.django-de.org/news/58-zweiter-django-stammtisch-in-berlin/">Find all the details here</a>. And since I will be in Berlin this time, I just simply redeclare this to &#8220;Django/Dojo Stammtisch&#8221; instead of just &#8220;Django Stammtisch&#8221; :-). I hope all the djangoers are ok with that (I requested permission in <a href="http://mibbit.com/?server=irc.freenode.net&#038;channel=%23django-de">#django-de</a>). It just makes things easier to also meet some dojo people in Berlin. I will also have some cool new <a href="http://dojango.org">dojango</a> stuff to show off!<br />
So if AJAX, JavaScript and Dojo people are around, it would be cool to meet you there and chat about what&#8217;s hot and how the beer is. Please add yourself to <a href="http://doodle.com/h7f64ga6n6tgdnxx">the attendees list on doodle</a>. And thanks again to the Berlin djangoers for organizing this, I am looking forward to it.</p>
]]></content:encoded>
			<wfw:commentRss>http://uxebu.com/blog/2009/04/06/djangodojo-stammtisch-in-berlin/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Dojango Version 0.3.1 (AppEngine release)</title>
		<link>http://uxebu.com/blog/2008/12/01/dojango-version-031-appengine-release/</link>
		<comments>http://uxebu.com/blog/2008/12/01/dojango-version-031-appengine-release/#comments</comments>
		<pubDate>Sun, 30 Nov 2008 23:51:58 +0000</pubDate>
		<dc:creator>tobias</dc:creator>
				<category><![CDATA[django]]></category>
		<category><![CDATA[dojango]]></category>
		<category><![CDATA[dojo]]></category>

		<guid isPermaLink="false">http://blog.uxebu.com/?p=94</guid>
		<description><![CDATA[After several weeks there is a new release of Dojango and this release introduces the compatibility to Google&#8217;s AppEngine. AppEngine delivers helpers so that Django applications can run on Google&#8217;s server farm and now this release of dojango allows the deployment of Dojo powered web applications to it. At the moment AppEngine just supports version [...]]]></description>
			<content:encoded><![CDATA[<p>After several weeks there is a new release of <a href="http://code.google.com/p/dojango/">Dojango</a> and this release introduces the compatibility to <a href="http://code.google.com/appengine/">Google&#8217;s AppEngine</a>. AppEngine delivers helpers so that <a href="http://www.djangoproject.com/">Django</a> applications can run on Google&#8217;s server farm and now this release of dojango allows the deployment of <a href="http://www.dojotoolkit.org">Dojo</a> powered web applications to it. <span id="more-94"></span></p>
<p>At the moment AppEngine just supports version 0.96 (see <a href="http://code.google.com/appengine/articles/appengine_helper_for_django.html">Google AppEngine Helper for Django</a>) of Django and dojango is now able to run with this old version.</p>
<p>Since dojo&#8217;s variety of modules easily excesses the limitation of Google&#8217;s AppEngine of 1000 files, dojango now can solve this problem with an <strong>extreme mini build</strong> that just keeps the basic dojo files and all image files. I have to mention that this build removes all js-files that could be postloaded on a page using <em>dojo.require</em>. This means, that a <em>dojo.require</em> on Dojo modules that weren&#8217;t included in the <a href="http://dojotoolkit.org/book/dojo-book-0-9/part-4-meta-dojo/package-system-and-custom-builds">Dojo build profile</a> would not work anymore. So, when using the extreme mini build, you have to add all Dojo modules, that are used within the deployed application, to your Dojo build profile.</p>
<p>I&#8217;ll show the deployment to AppEngine of a dojango application and the building of a Dojo release with the extreme mini build in another blog entry.</p>
<p>Dojango 0.3.1 also had some other changes, like the addition of Dojo 1.2 as the new default Dojo version for dojango and Google is now used as the default CDN instead of AOL. </p>
<p>Also two new decorator functions found their way into dojango. </p>
<p>One is the <strong>json_iframe_response</strong> decorator that makes it easier to return json data when <em>dojo.io.iframe</em> is used. <em>dojo.io.iframe</em> is utilized e.g., if you want to submit multipart/form-data forms with file fields in the background. Here is a simple example, how to use that decorator:</p>
<p>The Django side:</p>
<div class="codecolorer-container python twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br /></div></td><td><div class="python codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #ff7700;font-weight:bold;">from</span> dojango.<span style="color: black;">decorators</span> <span style="color: #ff7700;font-weight:bold;">import</span> json_iframe_response<br />
<br />
<span style="color: #66cc66;">@</span>json_iframe_response<br />
<span style="color: #ff7700;font-weight:bold;">def</span> my_view<span style="color: black;">&#40;</span>request<span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; <span style="color: #808080; font-style: italic;"># do your file handling here</span><br />
&nbsp; &nbsp; <span style="color: #808080; font-style: italic;"># and just return simple python objects like booleans, </span><br />
&nbsp; &nbsp; <span style="color: #808080; font-style: italic;"># Strings, integers, dictionaries, lists, ... </span><br />
&nbsp; &nbsp; <span style="color: #808080; font-style: italic;"># the decorator does the rest for you</span><br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: black;">&#123;</span><span style="color: #483d8b;">'success'</span>: <span style="color: #008000;">True</span><span style="color: black;">&#125;</span></div></td></tr></tbody></table></div>
<p>The Dojo side:</p>
<div class="codecolorer-container javascript twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">dojo.<span style="color: #660066;">require</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;dojo.io.iframe&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
dojo.<span style="color: #660066;">io</span>.<span style="color: #660066;">iframe</span>.<span style="color: #660066;">send</span><span style="color: #009900;">&#40;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#123;</span> <br />
&nbsp; &nbsp; &nbsp; url<span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;/my-view/&quot;</span><span style="color: #339933;">,</span> <br />
&nbsp; &nbsp; &nbsp; form<span style="color: #339933;">:</span> dojo.<span style="color: #660066;">byId</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;my_file_upload_form&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; handleAs<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;json&quot;</span><span style="color: #339933;">,</span> <br />
&nbsp; &nbsp; &nbsp; load<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>response<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>console.<span style="color: #660066;">log</span><span style="color: #009900;">&#40;</span>response<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p>The other decorator <strong>jsonp_response</strong> can enable django views to deliver json data to foreign web applications using JSONP. You need that, if you want to make several django views available as your external API. Here is a short usage example:</p>
<p>The Django side:</p>
<div class="codecolorer-container python twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br /></div></td><td><div class="python codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #ff7700;font-weight:bold;">from</span> dojango.<span style="color: black;">decorators</span> <span style="color: #ff7700;font-weight:bold;">import</span> jsonp_response<br />
<br />
<span style="color: #66cc66;">@</span>jsonp_response<br />
<span style="color: #ff7700;font-weight:bold;">def</span> my_view<span style="color: black;">&#40;</span>request<span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; <span style="color: #808080; font-style: italic;"># prepare and return your data</span><br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: black;">&#123;</span><span style="color: #483d8b;">'success'</span>: <span style="color: #008000;">True</span><span style="color: black;">&#125;</span></div></td></tr></tbody></table></div>
<p>The Dojo side:</p>
<div class="codecolorer-container javascript twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">dojo.<span style="color: #660066;">require</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;dojo.io.script&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
dojo.<span style="color: #660066;">io</span>.<span style="color: #660066;">script</span>.<span style="color: #660066;">get</span><span style="color: #009900;">&#40;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#123;</span> <br />
&nbsp; &nbsp; &nbsp; url<span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;/my-view/&quot;</span><span style="color: #339933;">,</span> <br />
&nbsp; &nbsp; &nbsp; data<span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span>doIt<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; handleAs<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;json&quot;</span><span style="color: #339933;">,</span> <br />
&nbsp; &nbsp; &nbsp; load<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>response<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>console.<span style="color: #660066;">log</span><span style="color: #009900;">&#40;</span>response<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #006600; font-style: italic;">// the returned json data is wrapped into that function!</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #006600; font-style: italic;">// always add that parameter</span><br />
&nbsp; &nbsp; &nbsp; callbackParamName<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;jsonp_callback&quot;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p>For the next release we planned to take <a href="http://groups.google.com/group/json-rpc/web/json-rpc-1-2-proposal">JSON-RPC</a>, <a href="http://groups.google.com/group/json-schema/web/service-mapping-description-proposal">SMD (Simple Method Description)</a> and maybe <a href="http://cometdproject.dojotoolkit.org/">CometD</a> into account. If you are interested in other features please don&#8217;t hesitate to contact us.</p>
]]></content:encoded>
			<wfw:commentRss>http://uxebu.com/blog/2008/12/01/dojango-version-031-appengine-release/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Home for the Dojo Foundation</title>
		<link>http://uxebu.com/blog/2008/10/21/home-for-the-dojo-foundation/</link>
		<comments>http://uxebu.com/blog/2008/10/21/home-for-the-dojo-foundation/#comments</comments>
		<pubDate>Tue, 21 Oct 2008 18:19:58 +0000</pubDate>
		<dc:creator>tobias</dc:creator>
				<category><![CDATA[django]]></category>
		<category><![CDATA[dojango]]></category>
		<category><![CDATA[dojo]]></category>
		<category><![CDATA[uxebu]]></category>

		<guid isPermaLink="false">http://blog.uxebu.com/?p=73</guid>
		<description><![CDATA[Finally the Dojo Foundation Web Site, a joined work of people from SitePen and uxebu, has launched. The main purpose of the site is explaining the intention of the Dojo Foundation, decluttering the Foundation from the Dojo Toolkit and giving all the other interesting projects under the hood of the Dojo Foundation a corporate presentation [...]]]></description>
			<content:encoded><![CDATA[<p>Finally the <a href="http://dojofoundation.org">Dojo Foundation Web Site</a>, a joined work of people from <a href="http://www.sitepen.com/">SitePen</a> and uxebu, has launched. The main purpose of the site is explaining the intention of the Dojo Foundation, decluttering the Foundation from the Dojo Toolkit and giving all the other interesting projects under the hood of the Dojo Foundation a corporate presentation location.</p>
<p>You can visit the site, that was build on top of <a href="http://code.google.com/p/dojango/">dojango</a> (wohooo) at <a href="http://dojofoundation.org">http://dojofoundation.org</a>.</p>
<p>It was great to work together with the people of <a href="http://www.sitepen.com/">SitePen</a> and I hope there will be more things in the future where we can join our forces.</p>
]]></content:encoded>
			<wfw:commentRss>http://uxebu.com/blog/2008/10/21/home-for-the-dojo-foundation/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Make &#8220;easy_install PIL&#8221; work</title>
		<link>http://uxebu.com/blog/2008/09/10/make-easy_install-pil-work/</link>
		<comments>http://uxebu.com/blog/2008/09/10/make-easy_install-pil-work/#comments</comments>
		<pubDate>Wed, 10 Sep 2008 18:32:02 +0000</pubDate>
		<dc:creator>wolfram</dc:creator>
				<category><![CDATA[django]]></category>
		<category><![CDATA[Tumbles]]></category>
		<category><![CDATA[imaging]]></category>
		<category><![CDATA[PIL]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://blog.uxebu.com/?p=61</guid>
		<description><![CDATA[Make &#8220;easy_install PIL&#8221; work]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.martin-geber.com/weblog/2007/08/22/problems-installing-easy_install-pil/">Make &#8220;easy_install PIL&#8221; work</a></p>
]]></content:encoded>
			<wfw:commentRss>http://uxebu.com/blog/2008/09/10/make-easy_install-pil-work/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Dojo namespacing with dojango</title>
		<link>http://uxebu.com/blog/2008/09/09/dojo-namespacing-with-dojango/</link>
		<comments>http://uxebu.com/blog/2008/09/09/dojo-namespacing-with-dojango/#comments</comments>
		<pubDate>Tue, 09 Sep 2008 19:01:28 +0000</pubDate>
		<dc:creator>tobias</dc:creator>
				<category><![CDATA[django]]></category>
		<category><![CDATA[dojango]]></category>
		<category><![CDATA[dojo]]></category>

		<guid isPermaLink="false">http://blog.uxebu.com/?p=59</guid>
		<description><![CDATA[This article describes, how you can create your own dojo namespace within a reusable django application when using dojango. It should give you an idea, where you place your javascript files and how you could structure your dojo namespace directory. When using dojango, where you are able to switch the source of dojo (a remote [...]]]></description>
			<content:encoded><![CDATA[<p>This article describes, how you can create your own dojo namespace within a reusable django application when using dojango. It should give you an idea, where you place your javascript files and how you could structure your dojo namespace directory. When using dojango, where you are able to switch the source of dojo (a remote CDN or a local version), there are several things to consider when creating your own namespace.<span id="more-59"></span></p>
<p>First I&#8217;ll explain how dojo uses namespaces and how you can preload files with it and afterwards i&#8217;ll describe how you setup a django project using dojango and adding your own django app with its own dojo namespace.</p>
<h2>Explaining the Dojo Loader</h2>
<p>It is important to understand, how dojo loads files and how dojo utilizes their namespace structure before creating your own one. </p>
<p>At the beginning there is the dojo base system, that is loaded via a script tag in your page and which enables the <em>dojo</em> namespace on your page:</p>
<div class="codecolorer-container javascript twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span> <br />
&nbsp; &nbsp; src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;/path-to-dojo-dir/dojo/dojo.js&quot;</span> <br />
&nbsp; &nbsp; djConfig<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;parseOnLoad: true, isDebug: false&quot;</span><span style="color: #339933;">&gt;</span><br />
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></div></td></tr></tbody></table></div>
<p>As you maybe already know, dojo comes with the two other namespaces <em>dijit</em> (layout and form widgets) and <em>dojox</em> (extensions for dojo and experimental stuff) and an addtional namespace called <em>util</em>, where the test-runner of dojo is located (concerning js namespace and dojo loadable module). You can see that stated in the 4 directories dojo delivers and where each directory represents a namespace:</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">.<br />
<span style="color: #000000; font-weight: bold;">|</span>-- dijit<br />
<span style="color: #000000; font-weight: bold;">|</span> &nbsp; <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #660033;">--</span> ...<br />
<span style="color: #000000; font-weight: bold;">|</span> &nbsp; <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #660033;">--</span> Editor.js<br />
<span style="color: #000000; font-weight: bold;">|</span> &nbsp; <span style="color: #000000; font-weight: bold;">`</span>--....<br />
<span style="color: #000000; font-weight: bold;">|</span>-- dojo<br />
<span style="color: #000000; font-weight: bold;">|</span> &nbsp; <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #660033;">--</span> ...<br />
<span style="color: #000000; font-weight: bold;">|</span> &nbsp; <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #660033;">--</span> dojo.js<br />
<span style="color: #000000; font-weight: bold;">|</span> &nbsp; <span style="color: #000000; font-weight: bold;">`</span>-- ...<br />
<span style="color: #000000; font-weight: bold;">|</span>-- dojox<br />
<span style="color: #000000; font-weight: bold;">`</span>-- uti</div></td></tr></tbody></table></div>
<p>Beyond loading the dojo base system you are then able for example to load the richtext editor widget by using the <strong>dojo.require</strong> function, that belongs to the dojo base system. By calling this function dojo resolves the namespace <em>dijit</em> relative to the parent directory (<strong>../</strong>) where the file <em>dojo/dojo.js</em> resides. The following <strong>dojo.require</strong> call would load the file <em>dijit/Editor.js</em> and all dependant classes and functions used by the richtext editor. If the dijit.Editor already was loaded it wouldn&#8217;t refetch the JavaScript files:</p>
<div class="codecolorer-container javascript twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; dojo.<span style="color: #660066;">require</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;dijit.Editor&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></div></td></tr></tbody></table></div>
<p>You can change the namespace resolving behavior by using the <strong>dojo.registerModulePath</strong> function. If you do that in front of the <em>dojo.require</em> call, the dojo module loader will deliver requested files of that defined namespace from the given path:</p>
<div class="codecolorer-container javascript twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">dojo.<span style="color: #660066;">registerModulePath</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;dijit&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;/another-path-to-dijit&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #006600; font-style: italic;">// or relative to the dojo/dojo.js file</span><br />
<span style="color: #006600; font-style: italic;">// dojo.registerModulePath(&quot;dijit, &quot;../relative-path-to-dijit&quot;);</span></div></td></tr></tbody></table></div>
<p>Besides that we also need to differentiate between a local and a xd (crossomdain) remote version to understand the module loading of dojo. </p>
<p>For a local loaded version (see <a href="http://code.google.com/p/dojango/wiki/AddDojoSource">Add Dojo Source Guide</a>) you just need to place your new dojo namespace directory (suggesting &#8220;myapp&#8221;) next to the dojo, dijit and dojox folder and you then can load your dojo javascript module <em>myapp/MyModules.js</em> with dojo.require(&#8220;myapp.MyModule&#8221;). Alternatively you can place your dojo module &#8220;myapp&#8221; somewhere else and register that path with dojo.registerModulePath.</p>
<p>Assuming you load dojo from an external CDN like AOL or Google and you also want to create your own local dojo namespace, you have to consider two things. One is that you have to set the parameter <strong>baseUrl</strong> in your djConfig to <strong>&#8220;/&#8221;</strong> when loading the dojo base system:</p>
<div class="codecolorer-container javascript twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span> <br />
&nbsp; &nbsp; src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;/path-to-dojo-dir/dojo/dojo.js&quot;</span> <br />
&nbsp; &nbsp; djConfig<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;parseOnLoad: true, isDebug: false, baseUrl:'/'&quot;</span><span style="color: #339933;">&gt;</span><br />
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></div></td></tr></tbody></table></div>
<p>The other thing is that you have to register your module path absolute:</p>
<div class="codecolorer-container javascript twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">dojo.<span style="color: #660066;">registerModulePath</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;dijit&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;/absolute-path-to/myapp&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p>Now you&#8217;ve understood the dojo module loader, you are ready doing the next step transferring your new knowledge to a concrete django application.</p>
<h2>Creating the reusable django app &#8220;myapp&#8221;</h2>
<p>We assume, that you&#8217;ve already installed dojango within one of your projects. If not, you first have to follow the instructions in the <a href="http://code.google.com/p/dojango/wiki/GettingStarted">getting started guide of dojango</a>.</p>
<p>First you have to create your own reusable app within your django project and add a directory, where you place your javascript and css files:</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #7a0874; font-weight: bold;">cd</span> mysite<br />
.<span style="color: #000000; font-weight: bold;">/</span>manage.py startapp myapp<br />
<span style="color: #7a0874; font-weight: bold;">cd</span> myapp<br />
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> media</div></td></tr></tbody></table></div>
<p>Within the media-directory you now can place the directory that serves as your new base dojo namespace. Our recommendation is to name the namespace and the directory like your django application (in this case: <em>myapp</em>):</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #7a0874; font-weight: bold;">cd</span> mysite<span style="color: #000000; font-weight: bold;">/</span>myapp<span style="color: #000000; font-weight: bold;">/</span>media<br />
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> myapp</div></td></tr></tbody></table></div>
<p>You also need to enable django to deliver the static files with your development webserver. For that you create a <em>myapp/urls.py</em> and add the media path to it:</p>
<div class="codecolorer-container python twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br /></div></td><td><div class="python codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">os</span><br />
<br />
<span style="color: #ff7700;font-weight:bold;">from</span> django.<span style="color: black;">conf</span>.<span style="color: black;">urls</span>.<span style="color: black;">defaults</span> <span style="color: #ff7700;font-weight:bold;">import</span> patterns<br />
<span style="color: #ff7700;font-weight:bold;">from</span> django.<span style="color: black;">conf</span> <span style="color: #ff7700;font-weight:bold;">import</span> settings<br />
<br />
urlpatterns <span style="color: #66cc66;">=</span> <span style="color: black;">&#91;</span><span style="color: black;">&#93;</span><br />
<br />
<span style="color: #ff7700;font-weight:bold;">if</span> settings.<span style="color: black;">DEBUG</span>:<br />
&nbsp; &nbsp; <span style="color: #808080; font-style: italic;"># serving the media files for myapp / dojo (js/css/...)</span><br />
&nbsp; &nbsp; urlpatterns +<span style="color: #66cc66;">=</span> patterns<span style="color: black;">&#40;</span><span style="color: #483d8b;">''</span><span style="color: #66cc66;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: black;">&#40;</span>r<span style="color: #483d8b;">'^media/(?P&lt;path&gt;.*)$'</span><span style="color: #66cc66;">,</span> <span style="color: #483d8b;">'django.views.static.serve'</span><span style="color: #66cc66;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: black;">&#123;</span><span style="color: #483d8b;">'document_root'</span>: <span style="color: #dc143c;">os</span>.<span style="color: black;">path</span>.<span style="color: black;">join</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">os</span>.<span style="color: black;">path</span>.<span style="color: black;">dirname</span><span style="color: black;">&#40;</span>__file__<span style="color: black;">&#41;</span><span style="color: #66cc66;">,</span> <span style="color: #483d8b;">&quot;media&quot;</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #483d8b;">'show_indexes'</span>: <span style="color: #008000;">True</span><span style="color: black;">&#125;</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">,</span><br />
&nbsp; &nbsp; <span style="color: black;">&#41;</span></div></td></tr></tbody></table></div>
<p>and include the app specific urls.py in your project&#8217;s urls.py, so all media-files are available below the url <em>/myapp/media</em>:</p>
<div class="codecolorer-container python twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br /></div></td><td><div class="python codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">urlpatterns <span style="color: #66cc66;">=</span> patterns<span style="color: black;">&#40;</span><span style="color: #483d8b;">''</span><span style="color: #66cc66;">,</span><br />
&nbsp; &nbsp; ...<br />
&nbsp; &nbsp; <span style="color: black;">&#40;</span>r<span style="color: #483d8b;">'^myapp/'</span><span style="color: #66cc66;">,</span> include<span style="color: black;">&#40;</span><span style="color: #483d8b;">'dojango.urls'</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">,</span><br />
&nbsp; &nbsp; ...<br />
<span style="color: black;">&#41;</span></div></td></tr></tbody></table></div>
<p>And also myapp must be enabled within your django project in <em>settings.py</em> (as with dojango):</p>
<div class="codecolorer-container python twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br /></div></td><td><div class="python codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">INSTALLED_APPS <span style="color: #66cc66;">=</span> <span style="color: black;">&#40;</span><br />
&nbsp; &nbsp; ...<br />
&nbsp; &nbsp; <span style="color: #483d8b;">'django.contrib.sites'</span><span style="color: #66cc66;">,</span><br />
&nbsp; &nbsp; <span style="color: #483d8b;">'dojango'</span><span style="color: #66cc66;">,</span><br />
&nbsp; &nbsp; <span style="color: #483d8b;">'myapp'</span><span style="color: #66cc66;">,</span><br />
<span style="color: black;">&#41;</span></div></td></tr></tbody></table></div>
<h2>Defining a Dojo Namespace with Dojango</h2>
<p>We propose a basic structure for your new namespace. You should create a file called <em>myapp.js</em>, where you can set all modules that should be loaded if your namespace is required and a file called <em>_base.js</em> that contains simple functions that you want to call directly below your namespace: something like myapp.showInfo(). This proposal was adapted from the dijit namespace:</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">`</span>-- media<br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">`</span>-- myapp<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">|</span>-- _base.js<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">`</span>-- myapp.js</div></td></tr></tbody></table></div>
<p>And here is the content of our myapp.js. As stated above we need two paths to our module, an absolute and a relative path. We&#8217;ve added an extra function called dojango.setModulePath, that is accepting an absolute and a relative path, so dojo source switching is working properly within dojango (Note: the function dojango.setModulePath will soon just need an absolute path, because we can calculate the relative path. But that change will be backwards compatible, so you don&#8217;t have to worry about it now!):</p>
<div class="codecolorer-container javascript twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #006600; font-style: italic;">// myapp.js</span><br />
<span style="color: #006600; font-style: italic;">// defining the package name</span><br />
dojo.<span style="color: #660066;">provide</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;myapp.myapp&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
dojo.<span style="color: #660066;">require</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;dojango.dojango&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #006600; font-style: italic;">// register the path for the namespace myapp</span><br />
<span style="color: #006600; font-style: italic;">// we need to pass a absolute and a relative url</span><br />
<span style="color: #006600; font-style: italic;">// - a remote xd-build will use the absolute url and</span><br />
<span style="color: #006600; font-style: italic;">// - a dojo version that is served locally is using the relative one</span><br />
dojango.<span style="color: #660066;">registerModulePath</span><span style="color: #009900;">&#40;</span><br />
&nbsp; &nbsp; <span style="color: #3366CC;">&quot;myapp&quot;</span><span style="color: #339933;">,</span> <br />
&nbsp; &nbsp; <span style="color: #3366CC;">&quot;/myapp/media/myapp&quot;</span><span style="color: #339933;">,</span> <br />
&nbsp; &nbsp; <span style="color: #3366CC;">&quot;../../../../../myapp&quot;</span> <span style="color: #006600; font-style: italic;">// relative to /dojango/media/dojo/version/dojo/dojo.js</span><br />
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #006600; font-style: italic;">// we always include our base-functions</span><br />
dojo.<span style="color: #660066;">require</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;myapp._base&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #006600; font-style: italic;">// if required, add more require-statements here ...</span></div></td></tr></tbody></table></div>
<p>And as told above we use the <em>_base.js</em> for placing our main functions, that we use throughout in our app, of our namespace:</p>
<div class="codecolorer-container javascript twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #006600; font-style: italic;">// defining the package name</span><br />
dojo.<span style="color: #660066;">provide</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;myapp._base&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
dojo.<span style="color: #660066;">require</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;dijit.Dialog&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
dojo.<span style="color: #660066;">mixin</span><span style="color: #009900;">&#40;</span>myapp<span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #006600; font-style: italic;">// showing a modal dialog window</span><br />
&nbsp; &nbsp; showDialog<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>title<span style="color: #339933;">,</span> content<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> foo <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> dijit.<span style="color: #660066;">Dialog</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>title<span style="color: #339933;">:</span> title<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; dojo.<span style="color: #660066;">body</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">appendChild</span><span style="color: #009900;">&#40;</span>foo.<span style="color: #660066;">domNode</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; foo.<span style="color: #660066;">startup</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; foo.<span style="color: #660066;">setContent</span><span style="color: #009900;">&#40;</span>content<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; foo.<span style="color: #660066;">show</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<h2>Using your Dojo Namespace within a Django View</h2>
<p>Now it is time to see everything in action. For a usage example we create a new url, a view and a template.</p>
<p>First mapping the url within <em>myapp/urls.py</em>:</p>
<div class="codecolorer-container python twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br /></div></td><td><div class="python codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">...<br />
<span style="color: #808080; font-style: italic;">#urlpatterns = []</span><br />
urlpatterns <span style="color: #66cc66;">=</span> patterns<span style="color: black;">&#40;</span><span style="color: #483d8b;">'myapp'</span><span style="color: #66cc66;">,</span><br />
&nbsp; &nbsp; <span style="color: black;">&#40;</span>r<span style="color: #483d8b;">'^example/$'</span><span style="color: #66cc66;">,</span> <span style="color: #483d8b;">'views.example'</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">,</span><br />
<span style="color: black;">&#41;</span><br />
...</div></td></tr></tbody></table></div>
<p>Then adding a new view to <em>myapp/views.py</em>:</p>
<div class="codecolorer-container python twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br /></div></td><td><div class="python codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #808080; font-style: italic;"># Create your views here.</span><br />
<span style="color: #ff7700;font-weight:bold;">from</span> django.<span style="color: black;">shortcuts</span> <span style="color: #ff7700;font-weight:bold;">import</span> render_to_response<br />
<span style="color: #ff7700;font-weight:bold;">from</span> django.<span style="color: black;">template</span> <span style="color: #ff7700;font-weight:bold;">import</span> loader<span style="color: #66cc66;">,</span> Context<span style="color: #66cc66;">,</span> RequestContext<br />
<br />
<span style="color: #ff7700;font-weight:bold;">def</span> example<span style="color: black;">&#40;</span>request<span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">return</span> render_to_response<span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;myapp/example.html&quot;</span><span style="color: #66cc66;">,</span> context_instance<span style="color: #66cc66;">=</span>RequestContext<span style="color: black;">&#40;</span>request<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span></div></td></tr></tbody></table></div>
<p>Lastly we create the template-directory:</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> myapp<span style="color: #000000; font-weight: bold;">/</span>templates<span style="color: #000000; font-weight: bold;">/</span>myapp</div></td></tr></tbody></table></div>
<p>And place our template <em>myapp/templates/myapp/example.html</em> there:</p>
<div class="codecolorer-container html4strict twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br /></div></td><td><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">{% extends &quot;dojango/base.html&quot; %}<br />
<br />
{% block dojango_header_extra %}<br />
<span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">script</span></a> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;/myapp/media/myapp/myapp.js&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">script</span></a>&gt;</span><br />
{% endblock %}<br />
<br />
{% block dojango_content %}<br />
<span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/input.html"><span style="color: #000000; font-weight: bold;">input</span></a> </span><br />
<span style="color: #009900;"> &nbsp; &nbsp;<span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;button&quot;</span> </span><br />
<span style="color: #009900;"> &nbsp; &nbsp;<span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;mybutton&quot;</span> </span><br />
<span style="color: #009900;"> &nbsp; &nbsp;<span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Show dialog&quot;</span> </span><br />
<span style="color: #009900;"> &nbsp; &nbsp;<span style="color: #000066;">onclick</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;myapp.showDialog('Awesome', 'It is working');&quot;</span></span><br />
<span style="color: #009900;"><span style="color: #66cc66;">/</span>&gt;</span><br />
{% endblock %}</div></td></tr></tbody></table></div>
<p>Start you django server via <em>python manage.py runserver</em> and test the example view here:</p>
<p><strong>http://localhost:8000/myapp/example/</strong></p>
<p>Yes. That really was a long blog article! But I hope, that this info will help you to build a nice ajaxified reusable application for django that is using dojo (and of coure dojango :-)).</p>
]]></content:encoded>
			<wfw:commentRss>http://uxebu.com/blog/2008/09/09/dojo-namespacing-with-dojango/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Ajax with dojango (dojo+django)</title>
		<link>http://uxebu.com/blog/2008/07/26/ajax-with-dojango/</link>
		<comments>http://uxebu.com/blog/2008/07/26/ajax-with-dojango/#comments</comments>
		<pubDate>Sat, 26 Jul 2008 19:40:11 +0000</pubDate>
		<dc:creator>wolfram</dc:creator>
				<category><![CDATA[django]]></category>
		<category><![CDATA[dojango]]></category>
		<category><![CDATA[dojo]]></category>
		<category><![CDATA[ajax]]></category>

		<guid isPermaLink="false">http://blog.uxebu.com/?p=40</guid>
		<description><![CDATA[Ok, now you got dojango and you want to write an AJAX app. There are some basics that just need to be provided in order to make that a piece of cake. Dojango offers them. And this article will show you how to best plug those pieces together and get up and running with ajax [...]]]></description>
			<content:encoded><![CDATA[<p>Ok, now you got <a href="http://code.google.com/p/dojango/">dojango</a> and you want to write an AJAX app. There are some basics that just need to be provided in order to make that a piece of cake. Dojango offers them. And this article will show you how to best plug those pieces together and get up and running with ajax and dojango.<br />
This article will show you how to simply pass data properly from the backend to the client.<br />
<span id="more-40"></span></p>
<p><strong>JSON communication with the server</strong><br />
There are enough use cases (and they are becoming more) when you want to get data from the server and the most common data format nowadays for that is <a href="http://en.wikipedia.org/wiki/JSON#Using_JSON_in_Ajax">JSON</a>, for various good reasons.<br />
Let&#8217;s construct a simple form who&#8217;s data we want to submit to the server and know if it all went ok or not. For now we just print the submitted data on the django console (from where you started the local dev server) and we let the user know about the submission with the small text &#8220;Submitted&#8221; beside the submit button.<br />
So let&#8217;s get started with the JavaScript side. Dojango luckily provides us with the basic infrastructure, so let&#8217;s create a template that extends <em>dojango/base.html</em> (it is available since the <em>settings.py</em> includes the app &#8220;dojango&#8221;, <a href="http://code.google.com/p/dojango/wiki/GettingStarted">see here for instructions</a>), that provides us with everything we need to have dojo running even the doctype of the document and HTML headers, just in short a valid HTML file, we only have to worry about our code.<br />
So let&#8217;s build the <em>simple.html</em> file in the templates folder of our django app (I called my app &#8220;core&#8221;).</p>
<div class="codecolorer-container html4strict twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br /></div></td><td><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">{% extends &quot;dojango/base.html&quot; %}<br />
<br />
{% block dojango_page_title %}Simple AJAX with dojango{% endblock %}<br />
<br />
{% block dojango_header_extra %}<br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">script</span></a> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; function userFormSubmit(){<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var form = dojo.byId(&quot;userForm&quot;);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dojo.xhrPost({url:form.action,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; handleAs: &quot;json&quot;,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; content:{surname:form.surname.value,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; firstname:form.firstname.value<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; },<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; load:function(response, ioArgs){<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dojo.byId(&quot;info&quot;).innerHTML = &quot;Submitted&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; });<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">script</span></a>&gt;</span><br />
{% endblock %}<br />
<br />
{% block dojango_content %}<br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/form.html"><span style="color: #000000; font-weight: bold;">form</span></a> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;userForm&quot;</span> <span style="color: #000066;">onsubmit</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;userFormSubmit(); return false;&quot;</span> <span style="color: #000066;">action</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;/simple-ajax-set/&quot;</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; First name: <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/input.html"><span style="color: #000000; font-weight: bold;">input</span></a> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;firstname&quot;</span> <span style="color: #66cc66;">/</span>&gt;&lt;<a href="http://december.com/html/4/element/br.html"><span style="color: #000000; font-weight: bold;">br</span></a> <span style="color: #66cc66;">/</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; Surname: <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/input.html"><span style="color: #000000; font-weight: bold;">input</span></a> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;surname&quot;</span> <span style="color: #66cc66;">/</span>&gt;&lt;<a href="http://december.com/html/4/element/br.html"><span style="color: #000000; font-weight: bold;">br</span></a> <span style="color: #66cc66;">/</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/input.html"><span style="color: #000000; font-weight: bold;">input</span></a> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;submit&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Submit&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span> <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/span.html"><span style="color: #000000; font-weight: bold;">span</span></a> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;info&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/span.html"><span style="color: #000000; font-weight: bold;">span</span></a>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/form.html"><span style="color: #000000; font-weight: bold;">form</span></a>&gt;</span><br />
{% endblock %}</div></td></tr></tbody></table></div>
<p>As you can see we are overriding a couple of blocks, that are defined in the <em>dojango/base.html</em>. The first one (line 3) is just for setting the page title, the second one (line 5) is for putting our JavaScript code inside html-head. And &#8220;dojango_content&#8221; (line 21) is finally the content of the body node.<br />
We also have to wire up the template to render when we access http://localhost:8000/simple/ and the AJAX method, that we submit the data to, like so in the <em>urls.py</em>:</p>
<div class="codecolorer-container python twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br /></div></td><td><div class="python codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #ff7700;font-weight:bold;">from</span> django.<span style="color: black;">conf</span>.<span style="color: black;">urls</span>.<span style="color: black;">defaults</span> <span style="color: #ff7700;font-weight:bold;">import</span> *<br />
<br />
urlpatterns <span style="color: #66cc66;">=</span> patterns<span style="color: black;">&#40;</span><span style="color: #483d8b;">''</span><span style="color: #66cc66;">,</span><br />
&nbsp; &nbsp; <span style="color: black;">&#40;</span>r<span style="color: #483d8b;">'^dojango/'</span><span style="color: #66cc66;">,</span> include<span style="color: black;">&#40;</span><span style="color: #483d8b;">'dojango.urls'</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">,</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: black;">&#40;</span>r<span style="color: #483d8b;">'^simple/'</span><span style="color: #66cc66;">,</span> <span style="color: #483d8b;">'core.views.simple'</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">,</span><br />
&nbsp; &nbsp; <span style="color: black;">&#40;</span>r<span style="color: #483d8b;">'^simple-ajax-set/'</span><span style="color: #66cc66;">,</span> <span style="color: #483d8b;">'core.views.simple_ajax_set'</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">,</span><br />
<span style="color: black;">&#41;</span></div></td></tr></tbody></table></div>
<p>We just added the two last lines that map our URLs (line 6 and 7) to the view functions.<br />
Our <em>views.py</em> just needs to implement these two functions, like this.</p>
<div class="codecolorer-container python twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br /></div></td><td><div class="python codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #ff7700;font-weight:bold;">from</span> django.<span style="color: black;">shortcuts</span> <span style="color: #ff7700;font-weight:bold;">import</span> render_to_response<br />
<span style="color: #ff7700;font-weight:bold;">from</span> dojango.<span style="color: black;">decorators</span> <span style="color: #ff7700;font-weight:bold;">import</span> json_response<br />
<br />
<span style="color: #ff7700;font-weight:bold;">def</span> simple<span style="color: black;">&#40;</span>request<span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">return</span> render_to_response<span style="color: black;">&#40;</span><span style="color: #483d8b;">'simple.html'</span><span style="color: black;">&#41;</span><br />
<br />
<span style="color: #66cc66;">@</span>json_response<br />
<span style="color: #ff7700;font-weight:bold;">def</span> simple_ajax_set<span style="color: black;">&#40;</span>request<span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; firstname <span style="color: #66cc66;">=</span> request.<span style="color: black;">POST</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">'firstname'</span><span style="color: black;">&#93;</span><br />
&nbsp; &nbsp; surname <span style="color: #66cc66;">=</span> request.<span style="color: black;">POST</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">'surname'</span><span style="color: black;">&#93;</span><br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">print</span> firstname<span style="color: #66cc66;">,</span> surname<br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: black;">&#123;</span><span style="color: #483d8b;">'success'</span>:<span style="color: #008000;">True</span><span style="color: black;">&#125;</span></div></td></tr></tbody></table></div>
<p>The function &#8220;simple&#8221; (line 4) uses the standard django way to render a view and return the content to the client. It finds the template <em>simple.html</em> in the app&#8217;s template path.<br />
The function &#8220;simple_ajax_set&#8221; (line 8) will receive our form data and (for now) only print them. You can see the first speciality here, it uses the decorator &#8220;json_response&#8221; that we imported from dojango.decorators. This decorator takes care of returning proper JSON data, all the data you stuff in there are returned to the client JSON encoded, it basically is <a href="http://wolfram.kriesing.de/blog/index.php/2007/json_encode-updated">json_encode as described here</a>. If you have AJAX calls and want to return JSON data, this is the easiest way to do it and it comes with dojango. It is a special (though very simple) implementation that has not made it&#8217;s way into the django core because it is really just AJAX-focused, while the django serializer is django model focused. Additionally this implementation solves a couple of problems and adds some features that are very useful when working with AJAX data, <a href="http://wolfram.kriesing.de/blog/index.php/2007/json-serialization-for-django">for more explainations see this article</a>.</p>
<p><strong>Handle the return</strong><br />
Now we can submit the form and see that the data got submitted. We don&#8217;t know yet if the data had been successfully handled on the server. So let&#8217;s add proper error handling.</p>
<div class="codecolorer-container javascript twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #003366; font-weight: bold;">function</span> userFormSubmit<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> form <span style="color: #339933;">=</span> dojo.<span style="color: #660066;">byId</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;userForm&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; dojo.<span style="color: #660066;">xhrPost</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>url<span style="color: #339933;">:</span>form.<span style="color: #660066;">action</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; handleAs<span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;json&quot;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; content<span style="color: #339933;">:</span><span style="color: #009900;">&#123;</span>surname<span style="color: #339933;">:</span>form.<span style="color: #660066;">surname</span>.<span style="color: #660066;">value</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; firstname<span style="color: #339933;">:</span>form.<span style="color: #660066;">firstname</span>.<span style="color: #660066;">value</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; load<span style="color: #339933;">:</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>response<span style="color: #339933;">,</span> ioArgs<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>response.<span style="color: #660066;">success</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dojo.<span style="color: #660066;">byId</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;info&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">innerHTML</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;Submitted successfully&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dojo.<span style="color: #660066;">byId</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;info&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">innerHTML</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;Error: &quot;</span><span style="color: #339933;">+</span>response.<span style="color: #660066;">error</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; error<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: #006600; font-style: italic;">// This happens on a 500 error or alikes.</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dojo.<span style="color: #660066;">byId</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;info&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">innerHTML</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;Error sending data.&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span></div></td></tr></tbody></table></div>
<p>If you looked into the return data (i.e. via FireBug) you might have seen that</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">{&quot;success&quot;:true}</div></td></tr></tbody></table></div>
<p>was returned. But until now this was passed into the load function (line 8) as a string, but we want them as JSON. So we have to tell the xhrPost() call to handle it as JSON (line 4). Now we can also evaluate the success value easily as shown in line 9. If the server returns</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">success</div></td></tr></tbody></table></div>
<p>with the value</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">false</div></td></tr></tbody></table></div>
<p>we know something went wrong on the server. Let&#8217;s implement on the server that the surname has to have at least three characters. In the case of an error the server returns the additional property &#8220;error&#8221; which we then show to the user (line 12) to inform him about the error.<br />
The function in line 15 handles all kind of connection and/or submission errors that may occur in a lower level. Make sure to not leave your users in the dark about this.<br />
Let&#8217;s look at the server code for that:</p>
<div class="codecolorer-container python twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br /></div></td><td><div class="python codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #66cc66;">@</span>expect_post_request<br />
<span style="color: #66cc66;">@</span>json_response<br />
<span style="color: #ff7700;font-weight:bold;">def</span> simple_ajax_set<span style="color: black;">&#40;</span>request<span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; ret <span style="color: #66cc66;">=</span> <span style="color: black;">&#123;</span><span style="color: black;">&#125;</span><br />
&nbsp; &nbsp; firstname <span style="color: #66cc66;">=</span> request.<span style="color: black;">POST</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">'firstname'</span><span style="color: black;">&#93;</span><br />
&nbsp; &nbsp; surname <span style="color: #66cc66;">=</span> request.<span style="color: black;">POST</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">'surname'</span><span style="color: black;">&#93;</span><br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #008000;">len</span><span style="color: black;">&#40;</span>surname<span style="color: black;">&#41;</span><span style="color: #66cc66;">&lt;</span><span style="color: #ff4500;">3</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; ret<span style="color: black;">&#91;</span><span style="color: #483d8b;">'error'</span><span style="color: black;">&#93;</span> <span style="color: #66cc66;">=</span> <span style="color: #483d8b;">'Surname is too short.'</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; ret<span style="color: black;">&#91;</span><span style="color: #483d8b;">'success'</span><span style="color: black;">&#93;</span> <span style="color: #66cc66;">=</span> <span style="color: #008000;">False</span><br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">if</span> ret<span style="color: black;">&#91;</span><span style="color: #483d8b;">'success'</span><span style="color: black;">&#93;</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;"># Store the data here</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">pass</span><br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">return</span> ret</div></td></tr></tbody></table></div>
<p>We extended the function a little bit to do some simple error checking. You can see that we add the key &#8220;error&#8221; to the ret dict, which is then passed to the client if the surname was shorter than three characters. The JSON string returned in this case is</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">{&quot;success&quot;: false, &quot;error&quot;: &quot;Surname is too short.&quot;}</div></td></tr></tbody></table></div>
<p>.<br />
Note that we didn&#8217;t explicitly set the value for</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">success</div></td></tr></tbody></table></div>
<p>to</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">True</div></td></tr></tbody></table></div>
<p>, the decorator</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">json_response</div></td></tr></tbody></table></div>
<p>handles that for us. If no exception is thrown it assumes that the function went ok and it can return</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">success=True</div></td></tr></tbody></table></div>
<p>. This comes in very handy, especially when you just have simple one task AJAX functions that i.e. just delete an item, you don&#8217;t have to return explicitly that the deletion went well,</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">json_response</div></td></tr></tbody></table></div>
<p>does that for you if you throw no exception. We just made it the default behavior since it was right for most of our use cases.</p>
]]></content:encoded>
			<wfw:commentRss>http://uxebu.com/blog/2008/07/26/ajax-with-dojango/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Dojango version 0.3 released</title>
		<link>http://uxebu.com/blog/2008/07/23/dojango-version-03-released/</link>
		<comments>http://uxebu.com/blog/2008/07/23/dojango-version-03-released/#comments</comments>
		<pubDate>Wed, 23 Jul 2008 20:58:35 +0000</pubDate>
		<dc:creator>tobias</dc:creator>
				<category><![CDATA[django]]></category>
		<category><![CDATA[dojango]]></category>
		<category><![CDATA[dojo]]></category>
		<category><![CDATA[reusable app]]></category>

		<guid isPermaLink="false">http://blog.uxebu.com/?p=37</guid>
		<description><![CDATA[Now it is official! We released Dojango on google code today and you can get details about it and download it from there. Dojango provides a dojo integration as a reusable app. Download it, copy it into your django project and you have dojo included into django. A quick summary of the main features of [...]]]></description>
			<content:encoded><![CDATA[<p>Now it is official! We released <a href="http://code.google.com/p/dojango/">Dojango on google code</a> today and you can get details about it and download it from there.<br />
Dojango provides a dojo integration as a reusable app. Download it, copy it into your django project and you have dojo included into django.</p>
<p><a href='http://code.google.com/p/dojango/'><img src="http://hub.uxebu.com:33550/wp-content/uploads/2008/07/dojango_logo.jpg" alt="" title="dojango_logo" width="120" class="alignnone size-full wp-image-38" /></a><br />
<span id="more-37"></span></p>
<p>A quick summary of the main features of dojango:</p>
<ul>
<li>a reusable django app that provides dojo</li>
<li>easy dojo setup inside django</li>
<li>build an optimized dojo</li>
<li>some helper functions, i.e. JSON conversion</li>
<li>switch easily between different dojo versions.</li>
</ul>
<p>The main purpose of dojango is to help you using dojo within your django projects. Currently it delivers the main infrastructure to easily switch between several dojo versions and includes several functions that helps developing rich internet applications. Now we are able to chain dojo and django on a solid basis and we work at porting the actual django form widgets to use dojo widgets.</p>
<p>We would be happy, if a lot of people would test the current version and tell us about bugs, strange behaviors, misunderstandings, &#8230; Also we are open for everyone who would like to help out extending dojango. In coincidence <a href="http://www.rsaccon.com/">Roberto Saccon</a> (big thanks!) already testet dojango with google app engine and it worked at first go.</p>
]]></content:encoded>
			<wfw:commentRss>http://uxebu.com/blog/2008/07/23/dojango-version-03-released/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>

