Why the webstandards world appears to be choosing Django
I’ve been noticing an interesting trend recently, not one I have any empirical evidence for mind, but one I though interesting non-the-less. Parts of the webstandards world appear to all be playing with Django. Part of this has been the odd mention down the pub, at barcamps or at SXSW this year. But the main source of information on the topic has been twitter. To name but a few I’ve seen tweets from Steve, Ross and Aral recently and Stuart and Cyril literally wont shut up about it.
What’s interesting is that this didn’t happen with Rails, not in the corner of the pub that generally talks more about markup, javascript and CSS anyway. I’ve worked on a couple of Rails projects both personally and commercially, and I’ve just launched a little pet project build with django called doesyourapi. What follows is, to my mind, a few reasons why I think this trend exists and also why I think it will continue, at least for the time being.
People
You can’t ignore the personal touch, and in Simon Willison and Stuart Langridge we already have two people who bridge the Python/Django community and the web standards crowd, at least in the UK. Personal technology choices at least are often driven by personal correspondence.
Templating
Django’s templating introduces a very simple syntax and nothing else. Rails lets you have the full power of Ruby to do with as you will within your views. Rails also makes heavy use of helpers, further adding to the complexity of views. Now I have mixed views here, based on my own skills more than anything. I know I’d feel much more comfortable throwing someone with good markup skills at a project using Django than Rails. For the most part with Django you use the html you’re used to, Rails often wants you to change this to helpers – in much the same way as ASP.NET does in fact. I think some of this comes from the Rails don’t repeat yourself philosophy obsession. Sometimes this leads to programmatic complexity which makes working with templates more akin to programming, even if it means less duplication. I’ve yet to work on a particularly complex Django project so maybe this simplicity might become a limitation to work around? Always a possibility.
Default craziness
Some of the bits and pieces that come bundled with Rails are just plain wrong, the Javascript helpers being one example. The abuse of HTTP by default in some of the scaffolding code being another. Oh, and the markup coming out of various helpers as well. In trying to help the application developer Rails gets in the way of the professional webstandards types. Django does next to none of this for you. Programmers coming from Rails might see this as missing features. Frontend types prefer this clean slate approach because it means you don’t have to fight the backend (sometimes including people) for control of the output. Note that you can work around much of this (in the same way as you can work around ASP.NET if you have to), it’s just nicer to not have to.
Other craziness
Rails people love Ruby. After all it’s better than Java (it’s also a pretty loveable programming language too). But like computer science departments everywhere many Rails people also dislike or simply put up with HTML, CSS and Javascript. If they can find a way of not having to write these and write something else (Rails people are also obsessed with domain specific languages) instead. Hence we have the likes of HAML and SASS. The problem is that us frontend loving folk quite like writing CSS (well, sometimes) and absolutely love writing HTML. Most of the time for good reasons too – just look at microformats for an example. Frontend developers tend to like using a mix of tools, predominantly backend developers not so much it seems.
Personally I find it interesting. You could quite easily flip many of these arguments around to support why so many people are using Rails. For two frameworks with similar goals and uses it’s interesting to see the early philosophical differences playing out in the real world. It might be interesting to see what happens with frameworks like Merb as well which seems to be set out to avoid many of these perceived issues with Rails. So, have anyone else noticed anything similar? Or even the complete opposite?
Comments
Thanks for writing this up. I am really perplexed as to why Django is being chosen over Rails or Merb. It is just not logical.
Zach Inglis - 29th March 2008
I’ve noticed that a lot of people are looking at Django recently also but I’m not sure that it’s to do with web standards. I think generally just that Django has reached a bit of a tipping point lately due to a number of factors. One being that a certain large employer is adopting it in the UK, another being that the first good books have turned up and I’m sure there’s more.
And, while I agree that Django hasn’t gone down the road of obtrusive JavaScript like Rails did and doesn’t try to write your markup for you as much, Rails has never enforced using any of these parts so it’s never been a problem. In fact, I came to Rails a good few years ago as a standards-aware developer because it was a great platform for standards-based development as did many other standards-based developers and designers. It’s just that Rails tipping point was about 2 years ago so its novelty has faded. At that time though, I’m sure that you could find an even larger section of the standards community raving about it.
However, I’m not taking anything away from Django and I’m glad that it’s getting its shine. Its made the right decisions in lots of places that Rails got it wrong. I’ve worked with it and like it myself. The reason I’m sticking with Rails at the moment is mostly to do with its extensive tool chain and the fact that I prefer Ruby to Python. I’d love to get involved with a Django project soon.
Dan Webb - 29th March 2008
I’ve been thinking of django for a while, but other projects haven’t left me with a chance to take a stab at it. My question is this: Learn Python to learn Django, or learn Python by doing Django?
Chris S - 29th March 2008
@Dan From my experience it was more the application developer community that really got excited a couple of years back with Rails, but I agree in general. Interesting that you mention tools. I’m pretty familiar with the common Rails bits and pieces (RSpec, Capistrano, etc.) but have yet to see tools for deployment for Django. I was unsure whether that’s because they don’t yet exist or that I haven’t looked for them as yet.
gareth - 29th March 2008
Django is being talked about more, and I’m thinking this is a lot to do with there being a lot of activity on the project as v.1.0 is fast approaching. I’m not sure this has much to do with Web Standards per se, however I think you will find that it has a lot do with people that want to build websites right, and this mentality extends to their choice of tools.
Reading Django’s documentation you get an immediate sense of how well thought out it is. I’ve used some ‘interesting’ technologies over the last few years and being able to use something that does it’s job in the right way without going too far down the road of “hand-holding” feels right to me. I like tools that do a job well and don’t get in my way so I can get stuff done. That’s the same reason why I choose Bazaar for VCS for example.
As always there are many different choices out there as to what tool you use to build a site. Django may not be a good fit for everyone and I’d recommend anyone to objectively qualify tools against their specific needs.
@Chris S: For me I picked up python before playing with Django and I’m glad I did it that way around though ymmv. I’ve worked with people who had never really touched Python before (thought they are already v.good programmers) and they dived straight into using Django picking up Python along the way and haven’t looked back since!
Stuart Colville - 29th March 2008
I started replying here but thought I may as well let it all out and turn it into a post: http://cyril.doussin.name/thoughts/the-current-django-trend.html
About Django tools, it is probably something that is being left for the community to handle. The core team building Django is building a framework, to address their and other people’s common needs. Deployment is something that should probably be more tailored to the environment in which you work (this is all very debatable of course, but it’s probably the reason why Django is not a project that ships with this kind of tools, at least for now).
The deployment issue is not something that has been dealt with completely yet (ie. no equivalent to Capistrano as far as I know, even though there someone has tackled the db upgrade issue with “django-evolution”), simply because the vast majority of people using Django haven’t had the need to. You can expect that with big employers and organisations jumping onboard these days, that’ll happen in the next year or year and a half.
And yes, Stu & I can’t shut up about it, it’s THAT good. And btw: Bazaar FTW! :)
Cyril Doussin - 29th March 2008
@Stuart: Agreed about the quality. It’s beautifully done. The way Merb is going gives me a similar feeling. Rails put forward lots of great idea but some parts were (and in some cases, still are) pretty sticky.
@Gareth: Me neither. I have had a reasonable look around what Python has to offer as well. Python is very mature and has a huge amount of libraries but some of Ruby’s tools are incredible. The best being Rake…it’s pretty essential to me now, but there’s loads more. Mongrel is a brilliant basis for any custom web servers you need, Capistrano is good obviously then there’s God which is my new favorite bit of kit and simple things like Hpricot and XMLBuilder.
Dan Webb - 29th March 2008
It’s nice to see Django’s web standards heritage being acknowledged – when Adrian and I started thinking it out in late 2003 web standards support was a really big deal for us. We had the advantage that pretty much everything preceding Django had been designed before web standards had become commonplace, and we took full advantage of the blank slate.
I tend to believe that the current uptick in interest is mainly down to maturity – Django’s been out for a couple of years now, the books are starting to emerge and 1.0 is actually really about to happen now.
As for deployment, there’s a great solution for deployment in the Django world: Capistrano! Great tools don’t have to be written in Python ;)
Simon Willison - 29th March 2008
Nothing wrong with Capistrano, someone has started work on a Python flavour however: http://pypi.python.org/pypi/Fabric/0.0.4 looks promising
Simon Scarfe - 30th March 2008
Hi,
Interesting article.It’s true that the trend is starting to be really noticed.Or maybe it’s just Stuart and Cyril who are just too vocal ;) .
I’m trying to convince my colleagues here at Opera (we’re working on http://my.opera.com/ ) to make the move, let’s hope we’ll go for it.
Tristan Turpin - 31st March 2008
Here what drew me to Django: I know Simon and if it deserves brain cycles from him then I thought it was definitely worth checking out. What made me stay, however, and what made me choose to use it for Singularity (when I have far more invested in PHP; making it the safe option) is the beauty of Python (especially for an ActionScript programmer), the quality of community (there are a lot of brainy people using Django right now and that means that when I Google for something I get a couple of well-written, thoughtful articles), and how easy it has been to integrate it with Flash and Flex (via PyAMF). Oh yes, and the ORM is awesome! (I’ve never liked writing SQL and the Django ORM writes better SQL than I can.)
I also looked into Rails but there’s too much magic in Rails for my liking. I can conceptualize Django, but not Rails. I feel I’m at a good level of abstraction with Django but I can drop down easily to the level below, which is very close to the metal.
(On the flip side, I did find setting up a development environment a bit laborious to start with on my Mac when compared to the ease of getting up and running with PHP.)
All in all, even though PHP “just works”, I find myself wanting to write Python (I never got pleasure out of writing PHP), and Django gives me a lot to work with without hindering my flexibility. (I’ve also found the mental leap of going back and forth between ActionScript and Python to be less jarring than that between PHP and ActionScript.)
Aral Balkan - 31st March 2008
Rails has attracted a lot of people who mistook the good tool set and DRY philosophy for “Rails writes my code for me”. They wanted re-usable widgets, modules, components and whatnot for their ground-breaking social bookmarking sites. That didn’t work out so well, because it’s not what Rails does best (and because these things never work out well).
Some parts of Rails are just useless (yes, JavaScript helpers, I’m looking at you), but people are starting to realise this now. Writing Rails apps that use semantic HTML and unobtrusive JavaScript is not a problem at all, it’s just that a lot of people who use Rails don’t care. That too is starting to change. The parts that aren’t useless (almost everything) are brilliant.
It seems to me like Rails attracts those who are more comfortable with server-side programming and want to be shielded from the crazy world of markup, browser incompatibilities and programming JavaScript, while Django attracts those from the other end who just want to deal with what they know best – markup, browser incompabilities and programming JavaScript – and be shielded from the backend “heavy” programming. Of course, I have no empirical data to support this argument, and there is much diffusion between the two groups. The Django group is the only one that can hope that their shield will hold up – you can’t abstract yourself away from HTML, CSS and JS.
The people factor is probably the catalyst that steers people from the same group towards one or the other. If you read that X, whose opinion you trust because he’s said some smart things in the past, uses Y, it’s likely that you’ll use Y too.
Tore Darell - 4th April 2008
I’ve seen front end guys swear they’ll never write HTML or CSS again without the help of HAML and SASS.
Wally - 4th April 2008
As another Django using (recently moved from TurboGears and Plone so not as huge a leap as most) standardista (WaSP emeritus) I guess I should comment.
I think there are a couple things going on. First, the MVC framework approach has been gaining ground everywhere. Too many people have been burned by tangled messes of PHP or lumbering J2EE stacks. If you’re a front-end person, you are probably either exploring them as a way to expand your skillset and be able to take on larger problems yourself, or the team that you work with is moving that way. Django is currently one of the best of breed in this area and has been seeing uptake across the board.
Standards folks have long been ahead of the curve in terms of seeing value in separating semantics and structure from presentation and I think that when they see the MVC approach, they realize that it’s an extension of the same principle all the way back down the stack. So that’s immediately appealing. (I’ve made that argument in the other direction in the past in my attempts at evangelizing the value of semantic markup to backend programmers.)
The templating language is an interesting area. I think there’s a strong case to be made for XML attribute based templating languages (ZPT, Kid, Genshi, etc) for standards support. With any of them, if your template renders at all, the output is going to be well-formed at the very least and keeping your markup valid becomes almost trivial. On the other hand, I do appreciate the simplicity of Django’s templates and I can see that it’s a worthwhile tradeoff for many. For standardistas coming to Django, it’s at least no harder to get their Django apps to validate than it was with plain HTML or whatever they were using before. There’s certainly less backend code to work around than with the typical PHP “template”. There’s nothing technically stopping Rails templates from being as standards friendly (except the lack of auto-escaping; Django only gets partial credit here as that was only added fairly recently) but in my experience writing Rails apps and seeing example code in the Rails community, Rails templates seem to rapidly turn into something that really barely resembles HTML.
anders pearson - 4th April 2008
The Web Standards reasons may be true, but for me personally I’ve drifted toward Django because of Python itself. It seems to be a safer choice given the underlying eco-system of the language.
Rob Nelson - 4th April 2008
It’s quite awesome to see people from this side of the pub taking on Django. Even though there’s the whole argument about learning Python over learning Ruby, Django just looked better to me. The thing is, it got me little by little.
I, like a few of us now using Django had somebody close to the project as a guide. In my case it was Jeff Croft and Wilson Miner. I watched the now-infamous “build a blog in 10 minutes” Rails screencast, and gawked when half of the time was taken to do the admin. Then I see Django saying “you get an admin for free!” Awesome. Second was generic views, it took me while to get a handle on them, but it felt like the more I worked with Django, the faster I’d find myself working in the templates and getting the real stuff done. ;)
Sure, I could have done the same thing with Rails, but one could say I didn’t want to or just refused to “join the club.” I’m like Aral above, I find myself wanting to do this—wanting to build anything and everything I can with it. Ultimately, I’m going to want to learn Rails, but I’m probably going to find myself stalling.
Bryan Veloso - 4th April 2008
[...] Why the webstandards world appears to be choosing Django [...]
Por que o mundo dos WebStandards parece optar pelo Django « Julio Vedovatto - 4th April 2008
Yeah. I think Python, and by extension Django, are of a similar aesthetic to Web Standards, appealing to those of us who want to simplify problems rather than over engineer. The choices Python has made (import antigravity, list comprehensions, forced indentation etc.) all add up to form a kind of obsessive beauty, which Django just carries on for the specific problem of building web apps (http at the core of what you are doing, no unnecessary abstraction, brilliant admin interface, newforms, simple project structure which is easy to extend, to name a few).
I also trust the developers to head in the right direction with the framework and not decide to add Javascript library X by default, make the right decisions on refactoring, not add any magic, and provide awesome depth of documentation. There seem to be as many discussions about removing problem code as there are about adding new features.
On the otherhand maybe Stuart and Cyril use twitter too much ;-)
Andrew Phillipo - 4th April 2008
One of the reasons we chose Django recently to help us writing the web front ends for our scientific research was its use of Python.
Python courses are mandatory for our students so they can start immediately coding Django projects after a short course.
The other thing is that Django more or less naturally forces them to structure applications and projects in a logical manner, something that come in very handy if you realize our ‘developers’ walk in and out at a 3–6 month schedule.
As site administrator I know how hard it is to refactor (or plain rewrite) someone elses code.
However….don’t forget about Perl. Perl and science is an ancient twin with a huge code base, tools and libraries, so one thing i’m willing to investigate is the use of Catalyst as well for those that feel more comfortable with the Camel.
Any comments on Catalyst?
Siv Hunter - 4th April 2008
I am myself a ruby user and do not use rails.
So i dont mind if anyone attacks rails etc.. brings points etc
but one thing is so incredibly incorrect that I think you should be aware of it.
It is also not specific to rails but instead a more general remark.
You wrote:
“The problem is that us frontend loving folk quite like writing CSS (well, sometimes) and absolutely love writing HTML.”
That is absolutely dead wrong. HTML, CSS, JS, XML etc… all begin to be more and more complicated but at the same time they fail to really empower people. How many use full javascript solutions that are complex, to achieve certain effects? what about flash?
The thing is, with growing complexity, one needs to find strategies to MANAGE this complexity.
It does not matter if it is django or rails or whatever, but as long as people continue to “write” html and not think about WHAT THEY REALLY WANT TO DO INSTEAD is where it will ultimately go wrong.
I myself write in a pseudo language and generate the format what i need (i.e. output a full html + css + javascript page).
My solution is still not perfect but I improve on it all the time.
I would NEVER go back to old-school html IF i can avoid it!
Hope you dont feel offended by this note it is not aimed at you, but against people that defend html too much. HTML5 will not make a big difference here btw, although some bits of it are actually an improve ;)
she - 4th April 2008
It seems to me like Rails attracts those who are more comfortable with server-side programming and want to be shielded from the crazy world of markup…
Not me. I first learned HTML and CSS. Then I picked up PHP. Did that for about four years. Two and a half years ago I moved to Rails and have never looked back.
I’m all for standards-based HTML and CSS and unobtrusive JavaScript. I’m also a solo developer, so I have to be good at all these things if I expect to create anything decent.
I dislike terms like “front-end guy” because I think it reinforces the very idea of a “front-end guy”. We’re web developers. We develop on the web and we should all strive to know as much as possible about our development environments.
Rabbit - 4th April 2008
What’s about ugly Django models? I use pylons now, this framework allows me to use power of sqlalchemy. Django models is very far out of sqlalchemy. This is main disadvantage of Django for me.
Andrew Svetlov - 4th April 2008
[...] Morethanseven » Why the webstandards world appears to be choosing Django [...]
Glen Scott > I’ve used Rails. It seemed a good idea at the time. - 4th April 2008
@Rabbit: I agree that we should, as web technologists, understand as much about web technologies as we can. But this doesn’t stop me from very definitely being an “engine room guy” – any design I produce will be somewhere between pedestrian and ugly, because my design skills aren’t graphical in nature – I build code, that’s what I am good at, and there are relatively few individuals who are good at both graphical and software design.
More generally, as a long-time Python user I was attracted to Django (having written a book about Python Web Programming) because it made a great decision about the split between computation and markup. I was amazed at how easy it was to build a relatively complex page structure automatically from the database and embed guaranteed-correct navigation structures into the basic template, which was then inherited by all page designs.
This didn’t happen by accident: the Ellington system was specifically designed to be useful to designers with no programming experience, and allows them to easily specify designs that programmers can easily populate: there’s just enough variability in the templating system for a designer to be able to wrap their head around it.
Steve Holden - 5th April 2008
I think that you may have missed the mark on HAML – HAML and SASS exist because of a love for HTML and CSS and it was written specifically to make UI/frontend designers as happy as possible.
HAML promotes very good habits when it comes to standards and it takes you away from having ugly views (both before and after rendering)
Casey - 5th April 2008
I don’t use Django or Rails, so this is just my impression as an outsider. It might not be the correct impression, but this is what I see.
PHP code gives you a lot of freedom, but the results can be quite messy if it is written by an unstructured programmer. Rails got a lot of early hype with its MVC method and “build a blog in X minutes” videos. This attracted many PHP coders who were shocked and awe. Some of them have never recovered from the shock and continue spreading the “rails way”.
Combined with a few Web 2.0 companies, at the time when Web 2.0 was given a name, and that Rails was backed by a company, this attracted even more PHP coders and Java coders to the platform.
I have the impression that Python coders were generally experienced programmers and people with a varied experience. Since Rails attracted most of the bad PHP coders, the Python community was spared the “barbarian hordes”. Many of the new developments made by Pythonistas, really show a commitment to existing standards. When I read intelligent articles about standards, it is more likely to be followed by a Python code example, than Rails.
I’m not saying that ALL rails coders are bad. I see lots of great code and standards compliant web sites out there. But it has a much greater share of former spaghetti/self-taught/script kiddies who have “seen the light”.
Neutral - 5th April 2008
[...] prefer [...]
Pharaos World - 6th April 2008
Oh yeah, about HAML and SASS – as someone else said they’re definitely not there to take away anything from HTML and CSS – or should I say the DOM (element tree), because that’s what it’s really about. HTML and CSS are syntaxes for describing and accessing the tree of elements, and they’re both very verbose. HAML and SASS are just different ways to represent the DOM in a more concise, readable and structured manner. HAML and SASS files contain exactly the same semantics as their HTML and CSS equivalents.
SASS represents a typical point where designers and programmers approach something differently. I’m constantly amazed when I see that well-known web designer’s style sheets have no structure at all (and still their designs are far better than anything I could come up with :-). The programmer in me makes me structure my CSS hierarchically (representing the DOM tree), and doing it manually was a major PITA with lots of repetition (and programmers hate repetition). SASS structures my CSS without making me repeat myself, and the end result is the same.
Tore Darell - 6th April 2008
[...] in the subject is my own mental point in the unordered list. This reason is the proper appreciation of web standards by the [...]
Sergei Mutovkin’s Rumbling Mumbling > Another reason for Django - 6th April 2008
[...] забавное Ñовпадение: вначале Gareth Rushgrove напиÑал Ñтатью «Why the webstandards world appears to be choosing Django», а потом, буквально через неÑколько дней, гугл [...]
django и google — software simian's typewritings - 8th April 2008
[...] to Twitter using PHPWhy the webstandards world appears to be choosing DjangoDebug web pages with Jquery and JashWho loses out to X-UA-Compatible?Continuous Integration for [...]
Morethanseven > DSLs for HTML and CSS - The Future, or Just Plain Wrong? - 11th April 2008
I love ruby. I hate rails… I am a ‘frontend loving’ type as you put it. I love good design and semantic markup.
Yet, I do all of my markup in Haml and SASS. Haml, I am far less enamored of than SASS… but SASS is just plain fuckin’ sex incarnate. You say you ENJOY writing CSS? I say, bullshit.
HTML, well… it’s quite verbose. Overly verbose. That just comes with the XML territory. But it’s nice, to be able to save half my time with Haml. I don’t always write in Haml, not when I’m just popping out a single page to describe something (elliottcable.name/contact.xhtml, rubydie.com) but I would never do an entire site by hand in HTML any more. Not when I can do it in Haml, require bits back and forth left and right in normal ruby, iterate repetitive sections, not worry about closing elements or wrapping structure… it’s made my life quite easier.
Rail on rails (hehe) all you want, but watch your footing with Haml and SASS. They are gods incarnate in this land of developers. Short them, and ware ye the six and a quarter hells I will bring precipitating down on your head.
Okay… so maybe not. But I seriously think you need to take a second look at them. You seem to have been ruined for the Ruby language by only seeing the Rails part of our community/code… you should jump into some of the OTHER Ruby frameworks, there’s a lot of ‘Good’ out there – more than more than more than enough to offset the Rails ‘Bad’. Check out Merb, Mack, Ramaze, and Sinatra for instance, they’re all very sexy – though Merb is the best of the bunch imho.
elliottcable - 14th April 2008
[...] Why the webstandards world appears to be choosing Django (tags: article programming python standards webdesign webstandards django comparison rubyonrails) [...]
links for 2008-04-30 at Ip’s - 30th April 2008
I like python and I’ve tested Django. Its really nice to play with it but how extensible is it? I am using Zend Framework because I think it’s really flexible. I build a higher level framework on top of Zend Framework. It don’t say “You have to do this in this way?”, you can create your own logic.
araba - 6th May 2008
[...] to Twitter using PHPWhy the webstandards world appears to be choosing DjangoDebug web pages with Jquery and JashWho loses out to X-UA-Compatible?Continuous Integration for [...]
Morethanseven > Of Hacking, Continuous Integration and Django - 21st June 2008
I’m a Ruby on Rails junkie but am not religious about it so when AppEngine came along I had good enough reason to take another look at Django. In any case I’ll continue to choose the right tool for the job, whatever that may be.
Sam J - 17th July 2008
Comments are now closed.