<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Django Architecture Approaches</title>
	<atom:link href="http://kosmaczewski.net/2008/04/04/django-architecture-approaches/feed/" rel="self" type="application/rss+xml" />
	<link>http://kosmaczewski.net/2008/04/04/django-architecture-approaches/</link>
	<description>sin incertidumbre no hay novedad, sin novedad posible no hay más que repetición y, por lo tanto, negación del otro como un ser libre: el ser libre es un ser incierto. (adrian mancuso)</description>
	<lastBuildDate>Mon, 15 Mar 2010 09:02:30 +0100</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Adrian</title>
		<link>http://kosmaczewski.net/2008/04/04/django-architecture-approaches/comment-page-1/#comment-14180</link>
		<dc:creator>Adrian</dc:creator>
		<pubDate>Fri, 11 Apr 2008 07:15:57 +0000</pubDate>
		<guid isPermaLink="false">http://kosmaczewski.net/?p=1141#comment-14180</guid>
		<description>The description is basically a tree, with a first level of leaves with the resources (one entry per URL described in the urls.py file) and, for each resource, each exposed method (GET, POST, etc) with its documentation, parameters, etc. You can have this in any format (JSON, XML, YAML) depending on the &quot;Accept:&quot; header MIME type, or the &quot;format&quot; parameter either in the GET or POST collection.
I agree that it&#039;d be great to make this project go forward! I think having a good REST interface in Django would make it useful for many new projects. Just a question, are you a committer of Django?
Cheers!</description>
		<content:encoded><![CDATA[<p>The description is basically a tree, with a first level of leaves with the resources (one entry per URL described in the urls.py file) and, for each resource, each exposed method (GET, POST, etc) with its documentation, parameters, etc. You can have this in any format (JSON, XML, YAML) depending on the &#8220;Accept:&#8221; header MIME type, or the &#8220;format&#8221; parameter either in the GET or POST collection.<br />
I agree that it&#8217;d be great to make this project go forward! I think having a good REST interface in Django would make it useful for many new projects. Just a question, are you a committer of Django?<br />
Cheers!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David, biologeek</title>
		<link>http://kosmaczewski.net/2008/04/04/django-architecture-approaches/comment-page-1/#comment-14149</link>
		<dc:creator>David, biologeek</dc:creator>
		<pubDate>Thu, 10 Apr 2008 18:23:41 +0000</pubDate>
		<guid isPermaLink="false">http://kosmaczewski.net/?p=1141#comment-14149</guid>
		<description>Looks great!

You Client additions reminds me a ticket where I&#039;d already done that (partly): http://code.djangoproject.com/ticket/5682

What&#039;s the format of the returned to describe your API?

Decorators on verbs/methods for fine grained access is what we&#039;d discussed recently on the rest-interface mailing-list, do not hesitate to post your enhancements.

This project really deserves a new team...</description>
		<content:encoded><![CDATA[<p>Looks great!</p>
<p>You Client additions reminds me a ticket where I&#8217;d already done that (partly): <a href="http://code.djangoproject.com/ticket/5682" rel="nofollow">http://code.djangoproject.com/ticket/5682</a></p>
<p>What&#8217;s the format of the returned to describe your API?</p>
<p>Decorators on verbs/methods for fine grained access is what we&#8217;d discussed recently on the rest-interface mailing-list, do not hesitate to post your enhancements.</p>
<p>This project really deserves a new team&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Adrian</title>
		<link>http://kosmaczewski.net/2008/04/04/django-architecture-approaches/comment-page-1/#comment-14103</link>
		<dc:creator>Adrian</dc:creator>
		<pubDate>Wed, 09 Apr 2008 14:59:50 +0000</pubDate>
		<guid isPermaLink="false">http://kosmaczewski.net/?p=1141#comment-14103</guid>
		<description>@David, @Batiste: I&#039;m sure that you can parameterize the decorators to make them return whatever you want... 
I am using decorators in the modified rest-interface to secure some resource methods if needed (for example, GET does not require auth but POST yes, and so on) and from what I&#039;ve seen, it&#039;s just syntax sugar for encapsulating functions inside other functions, so you can parameterize plenty of stuff with it!</description>
		<content:encoded><![CDATA[<p>@David, @Batiste: I&#8217;m sure that you can parameterize the decorators to make them return whatever you want&#8230;<br />
I am using decorators in the modified rest-interface to secure some resource methods if needed (for example, GET does not require auth but POST yes, and so on) and from what I&#8217;ve seen, it&#8217;s just syntax sugar for encapsulating functions inside other functions, so you can parameterize plenty of stuff with it!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Adrian</title>
		<link>http://kosmaczewski.net/2008/04/04/django-architecture-approaches/comment-page-1/#comment-14102</link>
		<dc:creator>Adrian</dc:creator>
		<pubDate>Wed, 09 Apr 2008 14:56:02 +0000</pubDate>
		<guid isPermaLink="false">http://kosmaczewski.net/?p=1141#comment-14102</guid>
		<description>Ahhhh I understand now :)
As for rest-interface: 
- I&#039;ve added support for the OPTIONS verb (and can be extended to other verbs like HEAD, too). 
- I removed the use of Django&#039;s own serialization of model objects, using native Python facilities instead, such as simplejson, yaml, XML, csv, etc, using a simple dictionary object as input for all of them, which includes not only the data, but also metadata (messages, timestamps, etc), and can then serialize any kind of data (arrays, typically). This way resources can return pretty much anything.
- I&#039;ve added some configuration values, with separate security checks for valid HTTP headers (they can be activated and deactivated in the settings file). 
- Most important: I created a special resource which returns the complete API description, which I then use to generate API wrappers in Python, Ruby, PHP, even Objective-C :) This means that each resource describes the input and output they require (kind of a poor man&#039;s WSDL, if you want)
- I&#039;ve also finished the implementation of Digest Authentication (what a mess, geez! Now I understand why only big companies use it!) 
- and finally I&#039;ve also extended the django.test.Client class (featured in a previous post in this blog) with support for PUT and DELETE and OPTIONS and Digest Authentication, 
- and added plenty of testing to all of this. 
Phew. :) I&#039;m sure it can be useful to others, and I hope to publish it as soon as possible!</description>
		<content:encoded><![CDATA[<p>Ahhhh I understand now :)<br />
As for rest-interface:<br />
- I&#8217;ve added support for the OPTIONS verb (and can be extended to other verbs like HEAD, too).<br />
- I removed the use of Django&#8217;s own serialization of model objects, using native Python facilities instead, such as simplejson, yaml, XML, csv, etc, using a simple dictionary object as input for all of them, which includes not only the data, but also metadata (messages, timestamps, etc), and can then serialize any kind of data (arrays, typically). This way resources can return pretty much anything.<br />
- I&#8217;ve added some configuration values, with separate security checks for valid HTTP headers (they can be activated and deactivated in the settings file).<br />
- Most important: I created a special resource which returns the complete API description, which I then use to generate API wrappers in Python, Ruby, PHP, even Objective-C :) This means that each resource describes the input and output they require (kind of a poor man&#8217;s WSDL, if you want)<br />
- I&#8217;ve also finished the implementation of Digest Authentication (what a mess, geez! Now I understand why only big companies use it!)<br />
- and finally I&#8217;ve also extended the django.test.Client class (featured in a previous post in this blog) with support for PUT and DELETE and OPTIONS and Digest Authentication,<br />
- and added plenty of testing to all of this.<br />
Phew. :) I&#8217;m sure it can be useful to others, and I hope to publish it as soon as possible!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David, biologeek</title>
		<link>http://kosmaczewski.net/2008/04/04/django-architecture-approaches/comment-page-1/#comment-14101</link>
		<dc:creator>David, biologeek</dc:creator>
		<pubDate>Wed, 09 Apr 2008 14:34:29 +0000</pubDate>
		<guid isPermaLink="false">http://kosmaczewski.net/?p=1141#comment-14101</guid>
		<description>Let&#039;s call this coincidence greut ;)

I&#039;m really interested in your enhancements, could you tell me more? Or maybe the rest-interface mailing-list is more appropriated? I hadn&#039;t enough time yet to extract my own from my current project but it could be awesome to update the quite-dead rest-interface project.

@Batiste : your approach is really neat. It doesn&#039;t handle different rendering, etc but it looks sufficient for some projects.</description>
		<content:encoded><![CDATA[<p>Let&#8217;s call this coincidence greut ;)</p>
<p>I&#8217;m really interested in your enhancements, could you tell me more? Or maybe the rest-interface mailing-list is more appropriated? I hadn&#8217;t enough time yet to extract my own from my current project but it could be awesome to update the quite-dead rest-interface project.</p>
<p>@Batiste : your approach is really neat. It doesn&#8217;t handle different rendering, etc but it looks sufficient for some projects.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Adrian</title>
		<link>http://kosmaczewski.net/2008/04/04/django-architecture-approaches/comment-page-1/#comment-14100</link>
		<dc:creator>Adrian</dc:creator>
		<pubDate>Wed, 09 Apr 2008 13:35:49 +0000</pubDate>
		<guid isPermaLink="false">http://kosmaczewski.net/?p=1141#comment-14100</guid>
		<description>Hi David!
Thanks for your comment! Now that&#039;s a coincidence, I&#039;ve stumbled on your site today for the first time :) I&#039;m using an enhanced version of the (excellent) rest-interface project which I hope to release to the public soon, adding some new features here and there.</description>
		<content:encoded><![CDATA[<p>Hi David!<br />
Thanks for your comment! Now that&#8217;s a coincidence, I&#8217;ve stumbled on your site today for the first time :) I&#8217;m using an enhanced version of the (excellent) rest-interface project which I hope to release to the public soon, adding some new features here and there.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David, biologeek</title>
		<link>http://kosmaczewski.net/2008/04/04/django-architecture-approaches/comment-page-1/#comment-14099</link>
		<dc:creator>David, biologeek</dc:creator>
		<pubDate>Wed, 09 Apr 2008 13:09:39 +0000</pubDate>
		<guid isPermaLink="false">http://kosmaczewski.net/?p=1141#comment-14099</guid>
		<description>@Adrian : I totally agree with you. I use the rest-interface project for all my apps now because that&#039;s really more powerful when you think in terms of resources and representations.

@James : you react on details but the related issue is more interesting...</description>
		<content:encoded><![CDATA[<p>@Adrian : I totally agree with you. I use the rest-interface project for all my apps now because that&#8217;s really more powerful when you think in terms of resources and representations.</p>
<p>@James : you react on details but the related issue is more interesting&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Adrian</title>
		<link>http://kosmaczewski.net/2008/04/04/django-architecture-approaches/comment-page-1/#comment-13955</link>
		<dc:creator>Adrian</dc:creator>
		<pubDate>Fri, 04 Apr 2008 19:01:02 +0000</pubDate>
		<guid isPermaLink="false">http://kosmaczewski.net/?p=1141#comment-13955</guid>
		<description>@James thanks for your comments; again, as I&#039;m not a native English speaker I might *grin* be using the word in non-conventional ways. Sorry for that. Secondly, I&#039;m not entirely arguing about a single example; I simply think that the choice of writing the name of the template at the end of the view is simply flawed, and that the tutorials should *also* point out other ways, which is not currently the case. As I pointed out at the end of the entry, it&#039;s an architectural problem, not specific to Django, by the way.</description>
		<content:encoded><![CDATA[<p>@James thanks for your comments; again, as I&#8217;m not a native English speaker I might *grin* be using the word in non-conventional ways. Sorry for that. Secondly, I&#8217;m not entirely arguing about a single example; I simply think that the choice of writing the name of the template at the end of the view is simply flawed, and that the tutorials should *also* point out other ways, which is not currently the case. As I pointed out at the end of the entry, it&#8217;s an architectural problem, not specific to Django, by the way.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: James Bennett</title>
		<link>http://kosmaczewski.net/2008/04/04/django-architecture-approaches/comment-page-1/#comment-13950</link>
		<dc:creator>James Bennett</dc:creator>
		<pubDate>Fri, 04 Apr 2008 17:11:48 +0000</pubDate>
		<guid isPermaLink="false">http://kosmaczewski.net/?p=1141#comment-13950</guid>
		<description>So, the things that bug me in your arguments are twofold:

First, you rely to an extreme extent on the word &quot;might&quot;. Something &quot;might&quot; not scale well; another thing &quot;might&quot; cause repeated code. Relying on situations where something &quot;might&quot; happen might lead you rather far astray.

Second, you&#039;re almost entirely arguing based off a single example from the Django tutorial, devoid of any further context; yeah, it doesn&#039;t paramaterize return types or template names or refactor itself into a class to dynamically handle any feature you want out of it, but in a web framework oriented toward returning rendered HTML via HTTP, is it really so evil to have the tutorial use that as an example? You apparently managed to work out that if you want to do tons of other things, it&#039;s easy enough to do so, so it can&#039;t be that hard.</description>
		<content:encoded><![CDATA[<p>So, the things that bug me in your arguments are twofold:</p>
<p>First, you rely to an extreme extent on the word &#8220;might&#8221;. Something &#8220;might&#8221; not scale well; another thing &#8220;might&#8221; cause repeated code. Relying on situations where something &#8220;might&#8221; happen might lead you rather far astray.</p>
<p>Second, you&#8217;re almost entirely arguing based off a single example from the Django tutorial, devoid of any further context; yeah, it doesn&#8217;t paramaterize return types or template names or refactor itself into a class to dynamically handle any feature you want out of it, but in a web framework oriented toward returning rendered HTML via HTTP, is it really so evil to have the tutorial use that as an example? You apparently managed to work out that if you want to do tons of other things, it&#8217;s easy enough to do so, so it can&#8217;t be that hard.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Adrian</title>
		<link>http://kosmaczewski.net/2008/04/04/django-architecture-approaches/comment-page-1/#comment-13939</link>
		<dc:creator>Adrian</dc:creator>
		<pubDate>Fri, 04 Apr 2008 12:27:55 +0000</pubDate>
		<guid isPermaLink="false">http://kosmaczewski.net/?p=1141#comment-13939</guid>
		<description>The &quot;Resource&quot; objects used in the Django REST project can have any number of methods in them, not only the __call__ method, so you can have some methods that return data and others that perform the serialization in whichever format you need.

Beware also of the fact that using objects means that you have an overhead in terms of instantiation and destruction, that you might not have using functions (however I don&#039;t know that well the inner workings of the Python runtime, and the relative costs of the decorator vs. the OO approach). I should have mentioned this in the article, by the way.</description>
		<content:encoded><![CDATA[<p>The &#8220;Resource&#8221; objects used in the Django REST project can have any number of methods in them, not only the __call__ method, so you can have some methods that return data and others that perform the serialization in whichever format you need.</p>
<p>Beware also of the fact that using objects means that you have an overhead in terms of instantiation and destruction, that you might not have using functions (however I don&#8217;t know that well the inner workings of the Python runtime, and the relative costs of the decorator vs. the OO approach). I should have mentioned this in the article, by the way.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
