tags:

views:

6158

answers:

9

What sequence of events made Django the most popular Python web framework .. and still so? Even though several other frameworks exist.

Note: This question is neither argumentative nor confrontational. I merely asked for (objective) "the sequence of events" that lead to its actual popularity. Being aware of the dynamics of software acceptance, I am not intending anyone to get into arguments over technical superiority.

+1  A: 

I noticed that it often got promoted as being the Ruby on Rails equivalent in Python. It's also has a connection to Google (Google hosts Django events, and supports it in their App Engine). A web framework being endorsed by Google has to amount for something. :)

joemoe
Sure, but GAE came much later in the process. And Django was already popular.
Sridhar Ratnakumar
@Sridhar, yep -- I made both points in my answer: GAE gave Django a big bump up on its announce date... but that was on top of a steady growth trend.
Alex Martelli
A: 

As for Django's popularity over time (the literal meaning of your question title, if not quite your actual question), have a look at the google trend.

Peter
THe trend link is wrong. As pointed out by @Alex Martelli, you need to get the guitarist out.
Jorge Vargas
+77  A: 

Many Python web frameworks already existed when Django appeared in 2005 -- indeed, the joke was already going around, by then, that Python is "the language with more web frameworks than keywords" (and Guido rejected my proposal to fix that in Py3k by adding many, many more keywords). Now "django" per se is a bit ambiguous as a search term (it's also the name of a popular guitar player whose life inspired a Woody Allen movie, etc, etc), nevertheless adding "python" to the search to remove those other meanings you can see e.g. in this graph how its relative popularity changed in comparison to another classic Python web framework, Zope. Mostly steady growth quarter over quarter, with a huge surprising jump up at the start of Q2 2008... which just happens to coincide with the date in which Google announced App Engine (it's impossible to prove causation in such case, but the coincidence is at least interesting;-).

App Engine essentially rules out any Python web framework that deeply depends on custom C-coded components, or intrinsically require "heavily relational" functionality; out of those that run well with just pure Python code, Django is probably the one that App Engine most directly and visibly supports. However, this was just a boost, adding to Django's underlying healthy growth trend. The explanation for that trend (and indeed for App Engine team and users' decision to support Django so well) must lie in characteristics that are intrinsic to Django itself.

Django is sometimes criticized (including by... yours truly;-) for being "too magical" or "too monolithic", compared to alternatives such as Pylons, TurboGears, Werkzeug, &c, which are lighter-weight (esp. the latter, my favorite;-), more transparent, and allow easier swapping in and out of specific components (ORM, templating, &c). However, Django's popularity tells us that, for most people interested in developing server-side web sites and apps, these Django design choices are perceived positively: Django's seen as a very rich and well integrated framework (and it does have a lot of add-ons and contributed "plugins", but those are more a consequence than a cause of its ascendancy).

Ease of getting started, automagical "admin pages", and the like -- as well as the fact that Django can be bent to make really rich and complex sites/apps and accommodate peculiar or unique requirements, with much skill and some work -- are probably the "killer features". To use Werkzeug at its best, you need to understand HTTP, and WSGI, and pick and integrate your favorite storage and templating -- developers of Python-based web sites and apps (like, in a sense, users of Rails, or users of even-more-popular PHP!-) are "voting with their mindshare" for an environment in which they need not necessarily do any of that, but can mostly focus on their application domain. I will have to admit that they probably do have a point;-).

Alex Martelli
Yes, they do seem to have a point and it amazes me how these factors drive popularity in general. Here I am - wondering which web framework to learn as "the" Python web framework to use in my projects: repoze.bfg or the good ol' Django?
Sridhar Ratnakumar
Google didn't *just* support Django with the App Engine. From what I understand they built an entire custom system that behaves in many cases almost exactly like Django. They could have done *that* for any framework, so I'm not sure Django's ability to run w/o any C libraries is the real reason it was chosen.
Triptych
I think, given Django's popularity, some familiarity with it will serve you well; that does not preclude also using repoze.bfg, werkzeug, etc, when they suit an app or site better. You could make a semi-toy project from scratch in each of them, if you have some time, and thereby gain a deeper appreciation for the strength and weaknesses that make them more or less appropriate depending on what a project entails (I have to admit I have no real-world first-hand experience with repoze.bfg...).
Alex Martelli
@Triptych, clearly not the _sole_ reason, since some other frameworks (**not** _any_ framework though: think Zope, for example!-) might have been just as applicable. I guess my musings about the pluses, to app/site developers, of richly integrated and somewhat "magical" frameworks may have swayed the decision of what to offer primary support for (e.g., by making it automatically available without requiring any user upload).
Alex Martelli
I think Java wins the prize for more Web frameworks than keywords.
cletus
@cletus, Java has 50 keywords per http://java.sun.com/docs/books/tutorial/java/nutsandbolts/_keywords.html, Python 2.6 has 31 per `len(keyword.kwlist)` -- e.g., typenames are not keywords in Python, etc.
Alex Martelli
I think you miss an important point. Django's documentation was (way) better than any Python framework (as well as better than rails documentation, IMO)
uswaretech
@uswaretech, good point - most opensource projects definitely don't have good-enough docs. But, really, how many people DO read the docs? Judging from SO questions, comments, and answers, 10% would seem to be the upper bound (which matches my previous feelings in the matter...).
Alex Martelli
BFG too has a policy of good documentation. http://bfg.repoze.org/
Sridhar Ratnakumar
@Alex, I doubt anyone actually reads the docs start to finish, but most people when they have a problem hit a google search. Being able to find the answer in 5 minutes using good-looking docs instead of 1 hour searching through blog posts is a big plus (it was until StackOveflow, at least, which made asking dumb questions much easier ;)
Edan Maor
One thing that should be pointed out is that Django since before it was a framework had a company behind it. This helped a lot in the bugfixing department which made people confident of it, that said I have heard that today getting a patch in is a huge pita.
Jorge Vargas
@Jorge, getting a patch in was quite a pita even in 2005 (I know, we tried, ended up running our own privately patched version for a LONG time before the Django trunk evolved to finally fix that bug).
Alex Martelli
I looked at Zope for a while, but it is way too complex for the casual (no time) or inexperienced developer, although I'm sure it is very powerful. The problem with Pylons is shifting sands, it keeps changing libraries! So at least with Django you have: 1) the blessing of GVR, 2) a package that contains everything, 3) a large support community, 4) good presentation and docs.
Nick
+72  A: 

I think there were a few factors, the combination of which was greater than the sum of their individual weights.

One is simply timing: Django appeared right as the first big wave of Rails hype was ramping up, and so it was immediately portrayed as being sort of "Python's answer to Rails". That resulted in a not-insignificant number of eyeballs on the project almost from the start. The fact that Adrian was at the "Snakes and Rubies" meetup in Chicago and got to take part in side-by-side talks about Rails and Django did a lot for that.

Another factor is that Django is and always has been a single-package install (well, not quite: you still need a database adapter, unless you're on Python 2.5+ and using SQLite, but close enough). The non-Zope alternatives, which all focused on leaving component choices in the developer's hands, required quite a bit more work just to get to the point where you could do a basic tutorial: you'd need to go hunting down an ORM, a template language, etc., etc. and get them all installed and configured. Though that's gotten much better over the years, I think the lingering memory of that still has an effect.

And Django came out of the gate with documentation that (if I may say so myself) was far above the usual standard for open-source projects, and has only gotten better over time. The tutorial, for all its many faults, hits on a number of the high points that make Django useful, and the remainder of the documentation has always been of good quality, mixing both API reference and important "how to" bits as needed. This produces a good out-of-the-box experience and helps with the post-tutorial learning curve (something which has always plagued Zope).

I also think there's a perception -- rightly or wrongly -- that, say, Pylons or Werkzeug really are better for experienced developers who already know their way around WSGI and the Python web ecosystem; the fact that they tend to be strong choices for taking your existing favorite libraries and plugging them together is the source of this, I think, and perhaps nudges some newer folks over toward Django's integrated approach. The flip side, of course, is that a lot of people who'd be better off learning more up-front before trying Django don't do that ;)

Finally, I think there's something to be said for the way Django's been marketed, which is to say that it really wasn't marketed for a long time, or at least not in the sense that, say, Rails was marketed. Until Django 1.0 landed, the "marketing" effort mostly consisted of people blogging (and there were some notable incidents where people were asked to tone it down a bit), talks at PyCon and then mostly just improving the framework, building cool things with it and letting the results speak for themselves. Now, of course, in the post-1.0 world we have the DSF and DjangoCon and business-oriented consultants doing training sessions and lots of books and all the rest, but that's all still quite new.

I expect that there will be a backlash, just as there's been with Rails, and in fact I think it's been brewing for a while and has already started. But up until now I think the factors I've listed here are at least the major ones behind the consistent, steady growth in popularity Django has seen since its initial release.

James Bennett
No need to be modest: the quality and quantity of Django's documentation is a huge plus for it. Well done, all.
Ned Deily
"Until Django 1.0 landed, the "marketing" effort mostly consisted of people blogging..." Are you forgetting the **two** books _published_ (i.e., in the works for a long time) before 1.0, one of them being yours? That sounds like some heavy marketing to me.
Cristian
Two books does not "heavy marketing" make, at least to me. And, to be honest, I'd have preferred to keep mine off until 1.0 was out, if only because it would've simplified my life quite a bit.
James Bennett
You should probably mention your involvement with Django, since it isn't as well-known on SO as, say, your blog. I seem to remember you writing something about this before, although I can't find the link atm.
Xiong Chiamiov
It's fairly easy to click on my name and see who I am.
James Bennett
I think it's important to have good docs because it shows that the developers have intent to produce something good, and it helps get developers off the ground. Lazy or incomplete docs generally mean a project is under resourced and you'll have to fix something yourself, which can be part of your decision to adopt.
Nick
+12  A: 

I can think of three reasons for Django's popularity, only one of which has been addressed in other answers as far as I see:

  1. Documentation. It's well structured, comprehensive, and approachable from a number of skill levels.

  2. Design. The visual design of the admin, error pages and the project site are far above the level of design seen with most open source projects.

  3. Community support. Starting with the team at World Online, Django picked up some influencial evangelists early on. I'm not sure you can over state the importance of blog posts like Jeff Croft's Django for Non-Developers (I think that was the title).

Tony
+9  A: 

"My personal favorite, and I expect that that will remain a personal favorite for a long time, is something named Django" - Guido Van Rossum on FLOSS weekly episode 11, aired aug 4th 2006

http://twit.tv/floss11 (listen to last third of the interview)

Think this might have helped? or at least the reason why Google chose it for AppEngine?

of course, the django community (including devs) are doing alot of things right. For example (Some analysis in the links):

Improving modularity: http://twothirty.am/blog/2009/04/09/django-code-base-modularity/

kick ass documentation http://twothirty.am/blog/2009/06/22/documentation/

There is also something about the community that gets people to want to contribute which I've yet to put my finger on: http://twothirty.am/blog/2009/08/11/contributor-analysis/

Of course, all that lead to Django being an outlier: http://twothirty.am/blog/2009/09/01/django-outlier/

There is no question about Django's popularity.

Up
I think this answer provides a bit the others don't. A LOT of people went blindly into Django due to that comment.
Jorge Vargas
Nothing wrong with doing it blindly when Guido describes it as such. I did, and never looked back since then.
Up
+1  A: 

In my case, I'd bought the TurboGears book, and struggled through its inconsistencies and haphazard route to explaining things. Then I got the Django book, and voila! My first for-pay project was created while working my way through the sample project in the book. That plus the online documentation sealed the deal. For me, it was simple: Documentation, documentation, documentation.

signal
A: 

The fact that there were several high volume sites already using Django (i.e. lawrence.com etc...) - even by the 0.96 days - helped me convince management it was safe to use. Things like Pylons and Turbogears really did not have that.

Rob
Fortunately those days are over, now that pylons now has reddit.com and sourceforge (via turbogears).
zzzeek
Pylons hasn't hit 1.0 yet, though, which I assume (haven't checked) means that they lack the API stability promises of Django.
Xiong Chiamiov
+2  A: 

At least for me, an important factor was that Simon Willison and Adrian Holovaty were already well known players in the "Web Standards" scene, as well as Jeff Croft later.

That wasn't only a quality seal, but also made Django very web-friendly, with its respect for HTTP, markup, and even the quick and dirty, "print debugging" way of working that people coming from PHP were used to.

I might be heavily wrong here, no data to back this up, but I feel that Django gained a lot more traction from people coming from PHP, as opposed to Rails which got a lot of conversions from Java/.NET.

As others already noted, the documentation is way above average. The best I've seen, as far as I recall.

Manuel Razzari