

The Onion Uses Django and Why it Matters to Us - theycallmemorty
http://www.reddit.com/r/django/comments/bhvhz/the_onion_uses_django_and_why_it_matters_to_us/

======
henriklied
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.

~~~
barnaby
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.

------
Kaizyn
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.

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

~~~
icey
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.

~~~
josephd
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.

------
wenbert
> 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 ;)

~~~
davidw
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.

~~~
gridspy
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!

------
midnightmonster
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.

~~~
josephd
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.

------
westbywest
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.

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

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

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

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

~~~
jrockway
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.

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

(Different strokes for different folks.)

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

~~~
ubernostrum
You might want to read the linked post.

