<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>jvoorhis comments on Second first impressions of Django</title>
    <link>http://www.jvoorhis.com/</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>jvoorhis comments</description>
    <item>
      <title>"Second first impressions of Django": comment by rick</title>
      <description>&lt;p&gt;Jeremy, regarding your beef with the URLs in the templating system, it looks like you &lt;em&gt;can&lt;/em&gt; decouple them.  It looks like you map the url to the app&amp;#8217;s  URL :&lt;/p&gt;


	&lt;p&gt;(r&amp;#8217;^weblog/&amp;#8217;, include(&amp;#8216;django_website.apps.blog.urls.blog&amp;#8217;)),
&lt;a href="http://code.djangoproject.com/browser/djangoproject.com/django_website/settings/urls/main.py"&gt;(django_website/settings/urls/main.py)&lt;/a&gt;&lt;/p&gt;


	&lt;p&gt;Then, the views in &lt;a href="http://code.djangoproject.com/browser/djangoproject.com/django_website/apps/blog/urls/blog.py"&gt;django_website/apps/blog/urls/blog.py&lt;/a&gt; assume you&amp;#8217;re starting from that weblog directory.&lt;/p&gt;


	&lt;p&gt;Course, you my have already figured this out since you posted this :)&lt;/p&gt;</description>
      <pubDate>Wed, 31 Aug 2005 14:13:08 NZST</pubDate>
      <guid>http://www.jvoorhis.com/articles/2005/08/19/second-first-impressions-of-django#comment-25</guid>
      <link>http://www.jvoorhis.com/articles/2005/08/19/second-first-impressions-of-django#comment-25</link>
    </item>
    <item>
      <title>"Second first impressions of Django": comment by Jeremy Voorhis</title>
      <description>&lt;p&gt;Python really wasn&amp;#8217;t too hard to learn. I kept a  PDF  copy of Diving Into Python handy. Some things were new to me, like tuples, but they seem just like constant arrays with an extra comma.&lt;/p&gt;


	&lt;p&gt;My impression of Python before ever using it was that it was a &amp;#8220;dynamic Java&amp;#8221;. After using it, that still doesn&amp;#8217;t seem so far off.&lt;/p&gt;</description>
      <pubDate>Sat, 20 Aug 2005 16:21:20 NZST</pubDate>
      <guid>http://www.jvoorhis.com/articles/2005/08/19/second-first-impressions-of-django#comment-23</guid>
      <link>http://www.jvoorhis.com/articles/2005/08/19/second-first-impressions-of-django#comment-23</link>
    </item>
    <item>
      <title>"Second first impressions of Django": comment by Derek Haynes</title>
      <description>&lt;p&gt;Thanks for the objective review! Having never touched Python, how much of a learning curve did you have with the language after using Ruby?&lt;/p&gt;</description>
      <pubDate>Sat, 20 Aug 2005 14:45:20 NZST</pubDate>
      <guid>http://www.jvoorhis.com/articles/2005/08/19/second-first-impressions-of-django#comment-22</guid>
      <link>http://www.jvoorhis.com/articles/2005/08/19/second-first-impressions-of-django#comment-22</link>
    </item>
    <item>
      <title>"Second first impressions of Django": comment by Jeremy Voorhis</title>
      <description>&lt;p&gt;Adrian,&lt;/p&gt;


	&lt;p&gt;As always, you&amp;#8217;re very welcome. I firmly believe in the value of an outside perspective. That being said, Django has helped me think about web development in new ways.&lt;/p&gt;</description>
      <pubDate>Sat, 20 Aug 2005 13:23:24 NZST</pubDate>
      <guid>http://www.jvoorhis.com/articles/2005/08/19/second-first-impressions-of-django#comment-20</guid>
      <link>http://www.jvoorhis.com/articles/2005/08/19/second-first-impressions-of-django#comment-20</link>
    </item>
    <item>
      <title>"Second first impressions of Django": comment by Adrian Holovaty</title>
      <description>&lt;p&gt;Thanks for your comments (and for your contributions on  IRC  and in the ticket system). Hope you stick around!&lt;/p&gt;</description>
      <pubDate>Sat, 20 Aug 2005 10:32:54 NZST</pubDate>
      <guid>http://www.jvoorhis.com/articles/2005/08/19/second-first-impressions-of-django#comment-19</guid>
      <link>http://www.jvoorhis.com/articles/2005/08/19/second-first-impressions-of-django#comment-19</link>
    </item>
    <item>
      <title>"Second first impressions of Django": comment by Jeremy Voorhis</title>
      <description>&lt;p&gt;RLivsey,&lt;/p&gt;


	&lt;p&gt;I like it. Add drag&amp;#8217;n&amp;#8217;drop and make it a gem!&lt;/p&gt;


	&lt;p&gt;Unless I do first&amp;#8230; I&amp;#8217;m halfway there :)&lt;/p&gt;</description>
      <pubDate>Fri, 19 Aug 2005 08:56:42 NZST</pubDate>
      <guid>http://www.jvoorhis.com/articles/2005/08/19/second-first-impressions-of-django#comment-17</guid>
      <link>http://www.jvoorhis.com/articles/2005/08/19/second-first-impressions-of-django#comment-17</link>
    </item>
    <item>
      <title>"Second first impressions of Django": comment by RLivsey</title>
      <description>&lt;p&gt;I made a pretty fully featured multi-select list a while ago.&lt;/p&gt;


	&lt;p&gt;http://livsey.org/experiments/multiselect/&lt;/p&gt;


	&lt;p&gt;Simply give your select box a class of &amp;#8216;multiselect&amp;#8217; and the javascript does the rest.&lt;/p&gt;


	&lt;p&gt;I&amp;#8217;m in the process of rewriting to use the prototype library, but it&amp;#8217;s still good to use in its current state.&lt;/p&gt;</description>
      <pubDate>Fri, 19 Aug 2005 08:48:13 NZST</pubDate>
      <guid>http://www.jvoorhis.com/articles/2005/08/19/second-first-impressions-of-django#comment-16</guid>
      <link>http://www.jvoorhis.com/articles/2005/08/19/second-first-impressions-of-django#comment-16</link>
    </item>
    <item>
      <title>"Second first impressions of Django" by jvoorhis</title>
      <description>&lt;p&gt;After completing the Django tutorial and tooling around with it, I got a better idea what it&amp;#8217;s all about. Django&amp;#8217;s big win is by far is its powerful dynamic admin. &lt;a href="http://jvoorhis.com/media/dynamic_admin_goodness.png"&gt;Look what I got for free!&lt;/a&gt;.&lt;/p&gt;


	&lt;p&gt;Ok. Not quite free &amp;#8211; I had to add a little bit of code to my models, but this added up to about 4 or 5 lines. I quite envy Django&amp;#8217;s many-to-many selector widget, and I&amp;#8217;ve begun making one with Rails, but using drag&amp;#8217;n&amp;#8217;drop instead of the buttons. Nice thing about the buttons, though, is that you can highlight multiple items on the left (without holding ctrl) and select them all with one click. Nice. And that template in the screenshot is just waiting for me to override it with Django&amp;#8217;s template language.&lt;/p&gt;


	&lt;p&gt;Another powerful thing in Django is the way it exploits the &lt;code&gt;__repr__&lt;/code&gt; method. Look at the &lt;a href="http://jvoorhis.com/media/dynamic_admin_goodness.png"&gt;screenshot&lt;/a&gt; again. It is not the best example, but you might get an idea of how adept Django can be in organizing data &amp;#8211; if there were indeed multiple artists, the selector would group albums by artist, and then display the albums in chronological order. As you might guess, I could easily change that behaviour in one line. The &lt;code&gt;__repr__&lt;/code&gt; method of the &lt;code&gt;Album&lt;/code&gt; model is what makes an album display itself as &amp;#8220;Artist name: Album title&amp;#8221; rather than just the album title.&lt;/p&gt;


	&lt;p&gt;Another nicety of Django is that certain field types have certain implicit behaviours. A &lt;code&gt;meta.FileField&lt;/code&gt; will automatically render itself as a file upload field in the dynamic admin. But that&amp;#8217;s not all &amp;#8211; it also encapsulates the functionality to upload a file to the directory specified by the application&amp;#8217;s &lt;code&gt;MEDIA_PREFIX&lt;/code&gt; setting. The downside? I could not delete the file once it was uploaded. Optimistically, I filed a ticket requesting this functionality.&lt;/p&gt;


	&lt;p&gt;One of Django&amp;#8217;s most controversial features is &lt;span class="caps"&gt;SQL&lt;/span&gt; generation. Initially, I found it worked quite well and there was no chance of my models being out of sync with the database. The pluggable applications manage their own tables, so when you drop an application into your Django project, you can run &lt;code&gt;django-admin.py install &amp;lt;app&amp;gt;&lt;/code&gt; and you&amp;#8217;re good to go. The big downfall? Change becomes cumbersome. Upon changing a model whose data is not expendable, you must alter the table manually. Otherwise, you may run &lt;code&gt;django-admin.py sqlreset &amp;lt;app&amp;gt;&lt;/code&gt; and pipe the output into your database like so: &lt;code&gt;django-admin.py sqlreset monkey | mysql -u root --database=monkey&lt;/code&gt;.  Rick Bradley has posted a well-written article to the Rails mailing list that treats this subject in more depth. It is also available at his &lt;a href="http://www.rickbradley.com/chron/20050817/"&gt;blog&lt;/a&gt;&lt;/p&gt;


	&lt;p&gt;Django also has what I would deem to be a major shortcoming in its template system &amp;#8211; urls have to reference the prefix at which the application is installed. For example, in the &lt;a href="http://www.djangoproject.com/documentation/tutorial1/"&gt;tutorial&lt;/a&gt; the base url for the polls application is &lt;code&gt;/polls&lt;/code&gt;. Templates within the polls application are required to be aware that they lived at &lt;code&gt;/polls&lt;/code&gt;. This means if I wanted to install the application at another location, I would have to find and replace every instance of &lt;code&gt;/polls&lt;/code&gt; in my templates. Rails solves this problem with its routing system, but routes can be difficult to use beyond a certain threshold of complexity. Django&amp;#8217;s facilities for regular expression-based url design allow you to create urls of any complexity, but I have not yet seen a solution to decouple the templates from their urls.&lt;/p&gt;


	&lt;p&gt;As I expected, I have to clarify a few things from the last article. First of all, Django&amp;#8217;s does have a capable equivalent of helpers &amp;#8211; custom tags and filters. You can define custom tag libraries and include them in your project to accomplish similar sorts of tasks one would use helpers for in Rails. Another retraction: as Adrian &lt;a href="http://jvoorhis.com/articles/2005/08/15/whats-a-django#comments"&gt;commented&lt;/a&gt; in my first Django post, Django is hardly like Rails at all. In terms of its goals, it is more like &lt;a href="http://openacs.org/"&gt;OpenACS&lt;/a&gt;.&lt;/p&gt;


	&lt;p&gt;My experience Django was positive. I finally got around to learning Python, and I got to weigh for myself the benefits and pitfalls of Rails&amp;#8217; and Django&amp;#8217;s techniques to implementing software patterns, such as object-relational mapping and &lt;span class="caps"&gt;URL&lt;/span&gt; routing. I can see how Django would be a good fit with the &amp;#8220;newsroom environment&amp;#8221; it was created for, and I left with the impression that Django is much more of a specialist than Rails. It does not strive to be an all things to all people framework, but rather an excellent starting point for implementing common website functionality.&lt;/p&gt;


	&lt;p&gt;Finally, another big win for Django is its active community. The guys in &lt;code&gt;#django&lt;/code&gt; are very friendly and the lead developer is accessible, open-minded and willing to discuss things. Thanks, Jacob!&lt;/p&gt;

</description>
      <pubDate>Fri, 19 Aug 2005 06:28:00 NZST</pubDate>
      <guid>&lt;a href="/articles/2005/08/19/second-first-impressions-of-django"&gt;Second first impressions of Django&lt;/a&gt;</guid>
      <link>&lt;a href="/articles/2005/08/19/second-first-impressions-of-django"&gt;Second first impressions of Django&lt;/a&gt;</link>
    </item>
  </channel>
</rss>
