The A.V. Club
Smart Pop-Culture — Wednesday, 8th April, 2009
The A.V. Club is the fun and smart pop-culture section of The Onion, a widely popular satirical news service. With a website originally powered by PHP content-management system Drupal, the team at The Onion have recently ported The A.V. Club to a custom-built Django solution. Why did they make the switch? How do they deal with a million unique visitors each month? This week I spoke with Tom Tobin, developer at The Onion, about their most recent project.
The Down-Low
The Onion is one of the worlds' most famous satirical news organisations, having survived since it's launch as a dead-tree newspaper in the late 1980's. More recently, The Onion has branched out into a number of other more serious projects including Decider, a local entertainment portal, and The A.V. Club, a smart pop-culture website.
The A.V. Club, one of the Onions' non-satirical departments, has been online for a number of years. Originally published as the AV section of the Onion newspaper, The A.V. Club was online as a Drupal website until it was recently re-written in Django.
Over a million people a month consume the A.V. Clubs' content, making it a fully-fledged online property in it's own right. It presents not only news and editorial views, but debate and reviews with a humorous tone.
Decider, another online property of The Onion, was built from the ground-up using Django after the team tested a number of different frameworks. Their custom commenting system, which frequently sees thousands of comments on any one article, was also running Django. This, plus the article-driven nature of the A.V. Club, made Django an obvious choice.
Originally built in Drupal, the team at The Onion spent about 3 months converting the A.V. Club website to Django, confident with its abilities after their experiences with Decider. Being able to use native Python code kept the development process speedy, and features such as the ORM and URL mapper have kept the code clean and easy to read.
Whilst the conversion process was mostly smooth sailing, Tom and his team had a few gripes with the way that Django worked.
For starters, the built-in admin application was just not up to scratch for the demands of an editorial office. A custom content-management system was written for internal users to use, however superusers still use the Django admin for maintenance tasks.
Of bigger impact than the limitations of the Admin, though, was the way that Django's default authentication framework splits the user and the related profile into two separate models. "It's maddening to be forced to perform joins to a separate table", says Tom. This caused enough pain for them that custom development was done to create 'model shadowing', a system that lets them add fields to existing models without touching their code or creating separate database tables.
Tom and the team at The Onion run on an up to date version of Django, allowing them to benefit from new features and fixes as soon as they are made public. "The lack of proper aggregation support was annoying, but that's fixed now. We track upstream aggressively, thanks to Django's extensive test suite."
To manage their development work, Git is used for version control amongst the five people working on the codebase. With three developers, a front-end developer and manager, life at The Onion isn't too complex to have fun. By using features standard to most distributed version control systems, features can be hacked on cleanly without impacting on the ability to complete important bugfixes or other code.
Front-end developers were initially shocked when they realised that arbitrary logic couldn't be run from templates. After working with Django for a little while, this constraint led to a better focus on developing the user interface rather than trying to force data into place. The feedback from designers suggested that "the template language itself feels simple and clean, and helps keep the markup readable."
To power a website with page views exceeding a million unique visitors a month, a number of strategies were implemented. Firstly, a CDN spreads the network load for serving static files. On the Django side, memcached is used extensively to lower database hits. A custom model object cache was written to improve this even further.
Other open-source software that is in use includes Typeface.js to render headings, jQuery for client-side scripting, Sphinx for searching, Git for distributed version control and Capistrano to assist deployment.
In return, they have released a handful of miscellaneous code snippets under a BSD license, called bulbs. Whilst all of these individual 'bulbs' are currently distributed together, as development continues some pieces will be spun off into their own projects. "No one wants to buy into grabbing everything you've open sourced just because they want to use one piece", says Tom. As time goes on more projects will find their way onto GitHub branches.
At the time of writing, two of the three major web properties at The Onion are running on Django. The last, The Onion website itself, is running on a heavily modified Drupal system. Although it's a longer term goal, converting The Onion to Django is high on the list of things that Tom and the web team wish to do. "Django affords us development advantages PHP can't match." We'll be sure to speak to Tom further when they make the big switch.
Thanks
Special thanks go to Tom Tobin for this interview.
The A.V. Club can be visited at http://www.avclub.com/. It is also listed at DjangoSites.org.
Comments
Posted by Buzz LIghtyear
11:44 p.m. on Tuesday, 19th January, 2010
thanx a lot for nice post.. Makes me believe, that i will (hopefully) transfer my sites to Django too :)
Posted by Kimsr33
1:54 p.m. on Tuesday, 9th February, 2010
If students are willing to see more facts about this good post, they would buy already written essays or <a href="http://www.gogetessays.com">buy custom essay papers</a> with the help of the custom writing service.
Posted by College Paper
4:42 p.m. on Thursday, 1st April, 2010
OK! good information, you know. Will use it in writing my essays.
Posted by rs gold
10:10 p.m. on Saturday, 5th June, 2010
Never frown, even when you are sad, because you never know who is falling in love with your smile.
Posted by rs money
10:11 p.m. on Saturday, 5th June, 2010
Don’t waste your time on a man/woman, who isn’t willing to waste their time on you.
Posted by rs money
10:11 p.m. on Saturday, 5th June, 2010
Don’t cry because it is over, smile,because it happened.
Posted by eve isk
10:12 p.m. on Saturday, 5th June, 2010
Life is a pure flame, and we live by an invisible sun within us.
Posted by guérison tatouage
2:02 a.m. on Saturday, 19th June, 2010
It can still enhance metabolism.It has thermogenic effect in the body
Posted by mortgage loans
5:13 p.m. on Saturday, 24th July, 2010
One remembers that today's life seems to be not cheap, however people require money for various things and not every man earns big sums money. Thence to receive some credit loans or just sba loan will be a right way out.
Posted by software development
7:35 p.m. on Wednesday, 14th October, 2009
Thta was an inspiring post,
thanks for providing thw down low on the onion
Thanks for bringing this up