Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
The Onion Uses Django and Why it Matters to Us (reddit.com)
116 points by theycallmemorty on March 25, 2010 | hide | past | favorite | 27 comments


I discussed this with a colleague of mine earlier today. I completely understand why they moved away from Drupal, but I'm not sure that "why Django matters to us" is the right way of putting it (although Django definitely works wonders for sites like The Onion).

"Why [a mature web framework] is the best fit for The Onion" is a more appropriate way of saying it. I've wrestled with enough blog platforms like Wordpress, where the client wanted it to work like a generic CMS, to know that the "You can put lipstick on a pig […]" phrase is very much applicable to web development.

Use the right tool for the job, damnit. And The Onion did.


While I agree all web frameworks are roughly on par, they do each have their particular strengths. The Onion could have gone with Rails, SPRING, Wicket, Cake, Symphony, or Pylons. They're equally as "good" as Django or any other framework.

However in this case Django is an outlier for what the use case they needed, after all it was created for content based web apps like LJWorld.


What's funny about this is that Onion is an online publisher just like the newspaper guys who wrote Django. This would have been more of a story if Django was incapable of fulfilling their needs.


Well any number of things are supposed to do something but never seem to take off. I think it's newsworthy that Django got this level of validation.


Are you contending that Django cannot do much beyond CMS? I think the contrary here.


I don't think that's his point at all. He's saying that they are playing directly into Django's strengths and therefore Django should work very well for them.


Thanks for clearing that out. Most people who discuss Django and other frameworks seem to hammer out the point about its CMS heritage a lot: as a way of contrasting it from Rails' web app heritage for instance, with some strange insinuations inferred. However, a quick glance at djangosites.org suggests that Django has been used for a wide array of projects from ecommerce to photo sharing and dating sites etc.,(not forgetting a newly discovered redditplus.com). And these are just a small sample reflecting the rapid evolution of the tool beyond its CMS heritage.


> That we could use the Django admin rather than create custom entry forms I think saved us 2 months work.

Wow! I agree with this. I was able to "preview" Django a few months back and I was blown away by the way it creates the admin forms. It almost feels like cheating ;)


I wonder if there's anything similar for Rails? The admin and user things are two aspects of Django that struck me quite positively, as a Rails user. I get annoyed with the half-baked auth things for Rails; it's not like I want to do anything that differently with each new site I do.


Django can reverse-engineer models from your database schema extremely easily. Once that is done it is 30 minutes (perhaps 4 hours for a novice) configuration and you have a working django admin site against your Rails DB.

This is how I started with Django, I migrated from hand-coded SQL to Django in one day (followed tutorial, found how to reverse engineer models and off I went).

See http://docs.djangoproject.com/en/dev/howto/legacy-databases/ for the reverse engineering bit. Tutorial starts here : http://docs.djangoproject.com/en/1.1/intro/

Give it a shot!


Yes and no. There have been some cool projects for Rails that provide administrative interfaces, but they all suffer from a lack of critical mass. Django's admin interface is just core to the framework - not because it has to be, but in the way that the core team sees it as something that can't languish.

On the horizon, merb-admin is being ported to Rails 3 by Yehuda Katz (http://yehudakatz.com/2009/12/31/spinning-up-a-new-rails-app...). If that comes to fruition, I think it might become a standard tool for Rails users who want admin pages. We'll see.

Being a part of the framework itself makes the Django admin interface always receive attention. Separate Rails projects do exist, but are often by one or a small number of people and not as widely used as the Django admin interface. So, they are there, but often don't have quite the polish and utility of Django's interface.


I can't say how good they are (as a guy that uses Django but takes a look at Rails about twice a year), but Google led me here:

http://ruby-toolbox.com/categories/rails_admin_interfaces.ht...

Typus seems the most Django-like.

Granted, a big advantage (as far as admin interfaces go) with Django is that almost every app uses it or at least keeps it in mind.


There's formtastic [1] to whip up forms according to the models. Using this and some DRY admin controller you can assemble an admin controller pretty quickly. Still, nowhere as fast as the Django admin. There are also some plugins to get an admin but they never did it for me.

[1] http://github.com/justinfrench/formtastic


Same with Drupal: create a type (using the web interface or via code) and you get free admin forms.


Don't forget though that you have to hack the forms to remove all the confusing garbage admin stuff that Drupal will display to anyone you give node admin permissions to.

It's a real pain in the butt to create user facing content creation forms in Drupal.


It's pretty rare that you'd give full node admin permissions to typical business users or end users. "Create" and "edit" permissions are usually sufficient for most elevated roles, and that hides a lot of the admin-specific functions that show up on the forms, no?


Very true. Drupal is like Microsoft Word... it takes initiative to do things you may not have asked for.


I appreciate this link. I gave up reddit for lent since it's mostly just a way to waste time for me. I was comfortable doing it since I was confident that anything really good would get linked on HN, too. I'm pleased to see that a worthwhile discussion thread, even on a relatively small subreddit, made it here.


Yes, scouring the subreddits can turn up useful discussions like these. I think Django needs more of this exposure from major sites that have used them just to show what is possible with the framework. If one looks at frameworks generally and maps popular website to a framework(e.g. Php to Facebook, Java to Amazon, Ruby to Twitter) they have an idea of what can be done with that tool and Django sure needs a lot more exposure like this.


It's also worth pointing out unit tests as one of the stated reasons for switching to Django. Drupal's unit testing is essentially voluntary for the current major version (mandatory in the next), meaning it engenders lots of crap, some of which I've written.


> The biggest performance problem I have with django is the ORM

ORM is not the database access layer you are looking for.


Yeah. If you have objects, skip the relational mapping and just use an object graph database.


or if you have relations, skip the object mapping and treat the data as lower level structures.


No. Don't do that.

The data in your computer program needs to be in a format that's easy for your program to use.


set and lists and dicts and raw values are pretty damn easy. Especially if you're programming functionally etc.

(Different strokes for different folks.)


Onion also uses Drupal.. Tho hopefully they've gotten smart enough to ditch it.


You might want to read the linked post.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: