Blog of Jeff A blog about programming and random other things.

30Mar/09link

Django Blog Tutorial

Check out my guest posts on creating a blog in Django.

I'll update this post whenever new parts are released.

Update: Part 2 Part 3 Part 4 is now out.

  • Share/Bookmark
28Mar/09link

Rails and Django

Notice: As with all people, I have a bias. Mostly towards python over ruby. Keep that in mind ;)

Ever since the release of Ruby on Rails, shortly to be followed by Django, programmers always compared the two to determine the ultimate question: "What is better?" But this is purely on personal preference. It's like comparing apples to oranges. People like each for different reasons that can't be summed up for everyone.

Rails and Django were both extracted from other projects, but each project weren't identical. Rails was originally part of basecamp, which is a ajax web application where as Django was extracted from lawrence journal world. Both focused on different parts of the development process.

Rails was initially developed by one person (David Hansson), to be an "enjoyable experience" for creating web-based products. These includes reasonable defaults and a more restrictive design for the user of the framework. This improves productivity by reducing the brain power used for making petty choices (such as where to store source code file x). But like any good framework, if you truly wanted to do it differently, you can with a bit of tweaking. Since Rails was part of basecamp, it is particular efficient at rapid development for user-generated content (not by some admin) and simplifying repetitive and tasks. An added benefit of Rails is its integration of the prototype / scriptaculous javascript frameworks. Although if you don't like prototype, there are implementations for other frameworks in the works. However, due to Rails' erb templates uses functions over just plain html when possible, the prototype integration is much stronger. I feel myself viewing source for my own applications to get ids that Rails generates for custom javascript.

Django was created by three people (Adrian Holovaty, Jacob Kaplan-Moss, and Simon Willison) for "perfectionists with deadlines". This is more of a traditional websites framework. Since Django was born in the media world, where sites and content need to be completed in hours, Django tries to assist in automating as much as possible. Backend admin pages are automatically provided and common data fetching practices are simplified as much as possible without compromising restricting the developer to the confines of the framework. Since Django was designed for outputting content, it's not as efficient for generating Rails-styled user generated application (although still possible). Django's templating system tries to minimize the amount of magic which leads to more manual html code. And as you can expect, it lacks integration with a particular javascript framework. Also, since the Django admin is nearly completed automated, it's more difficult to make changes to the interface and definitely not tailored for end-users. But, the templating system is friendlier to designers who never used a programming language before.

That sums both frameworks up. Which should you choose? If you rather not deal with javascript code that much but intend on using bits and pieces here and there, use Rails. If you have a lot of content to manage (maybe not by you), give Django a whirl. If you have a language preference, go with the corresponding framework, although I strongly recommend to investigate the other language if you haven't already (See "The Blub Paradox" section of "Beating the Averages").

  • Share/Bookmark
25Mar/09link

Moving

Just a heads up, I'll be moving the blog to the subdomain http://blog.jeffhui.net to make room for additions when I get around to doing so, which might be not be for awhile, but change is slow, so I'll switch the url now. Until I update the homepage, http://jeffhui.net and http://www.jeffhui.net will redirect to the new location.

  • Share/Bookmark
Filed under: JeffHui.net 1 Comment

Recent Posts

Topics

Archives

Following

Links