views:

808

answers:

8

Having read some great things about the Django framework I'm becoming quite interested in it. But before making my decision to use it for a small project I would like to hear some more down to earth opinions: Please write of your experience with the framework beyond the usual "toy" website and how well it compares generally with other major web frameworks (ASP.NET, RoR, etc.)

+3  A: 

warning: shameless self promotion follows

I use django, and I've written up a bit about my experience with it.

It's not bad, it gives you a great starting point, but at some time in the future, you'll find yourself fighting it, or doing things without its help, because it's easier that way.

For instance, the automatic admin interface is fine for simple things, but eventually you'll want to create a very costumized interface for managing your website, and the auto admin site just won't cut it.

hasen j
To add on to what hasen said -- the admin site IS quite customizable, but you have to put a lot of work into shaping it the way you want (overriding default methods, creating your own templates, creating custom widgets, etc.). It becomes a trade off of doing-it-yourself vs. learning-the-api.
T. Stone
When you say " the automatic admin interface is fine for simple things, but eventually you'll want to create a very costumized interface for managing your website, and the auto admin site just won't cut it.", As a Django fan boy, let me ask you, which other framework gives you a Admin which is even close to what Django gives you. What will you have an Admin which is hard to customise, or no admin at all? Also Admin is just a contrib app, not a core part of Django (Although one which everyone uses).
uswaretech
The Django admin is great, but it's limited. Eventually you *will* want to replace it, if you're doing anything serious.
hasen j
I've found that even when I "replace" the admin, I end up hooking back into it, e.g. to allow people to add options to a ForeignKey/ManyToMany select box, and cribbing its widgets.
jcdyer
+13  A: 

I built a newspaper CMS to bring my student paper online in college. Django was the perfect fit (I found RoR unintuitive and frustrating). I was able to develop rapidly in a language I loved, supported by an excellent community and with a wealth of documentation. It abstracted-out just enough to speed development and gave me enough power to design a system that did exactly what I needed. I didn't feel locked in, but I understand that some do. This is a compromise you implicitly make, it's part of the buy-in with any framework. The only "framework" that fits everyone's needs for the life of their project is no framework at all.

The important question is not whether or not you are trapped in a box, but whether or not you are able to step outside the box when the time comes. To this end I'll argue that no framework is very good at this at the moment, but I believe Django deserves some credit here because the Django guys & gals definitely know this. To quote Jacob Kaplan-Moss, one of Django's co-creators:

It’s important to realize that the most important kind of inter-operability is with the user’s code, and frankly web frameworks often suck here. A basic truth of software is that as it grows and matures it becomes more and more domain-specific, and less and less generic. I’ll talk more about this below; the important part for now is to realize that general frameworks should be able to cede control to domain-specific replacements as the stack grows. For the most part, frameworks don’t.

We can only hope that we'll see Django reach a place where you can "outgrow it" comfortably, and in fact I'm confident it will. Any framework will speed development, but if you opt for Django you'll be in very good hands.

Matt Baker
I tend to agree that django's strength is it's flexibility. There's a lot I like about it, but almost as much that I'd like to be different. So far I've swapped out almost every piece of django, at one point or another, and this has been very smooth.
TokenMacGuy
Building a newspaper CMS from scratch is **THE BEST** possible situation for using django. Django's roots are in a newspaper and I haven't found any language/framework/package that even remotely competes for these types of sites.Django's main limits are it's ORM, superficial participation in WSGI (only matters if you're a pythonista), and relative lack of features for building service oriented websites. The ORM mainly comes up when you're integrating or have to work with a legacy DB and there you'll want SQLAlchemy.
Karl Guertin
"Building a newspaper CMS from scratch is THE BEST possible situation for using django. Django's roots are in a newspaper..."Yes indeed! You can imagine how quickly I fell in love with a framework that already had a "slug" field! :)
Matt Baker
+9  A: 

The company that currently rents my brain is using Django as a replacement for a big stack of java based technologies. We are not doing anything external facing yet - mostly internal applications with small load.

What got us hooked was, frankly, two-fold:

  1. Python (much more expressive, yet more concise, than Java)
  2. The Django community

Communities for other alternatives had an almost belligerent attitude towards newbies - that has not been my experience with Django - and in general tended to elevate the framework to the status of "the one to rule them all". As you can tell by the answers here - Django people tend to see the good and the bad; very refreshing.

Matt Baker's mention of "Snakes On The Web" is right on. The job of a framework is to make the boring, repetitive stuff easy; and the hard, interesting work doable. IMO Django delivers here because of its philosophy.

Somethings are still evolving... Schema migration, for instance, is an area that doesn't come defined with the main Django framework (you can always use South, but it currently is an add-on). Multiple database support is non-existent (but, allegedly coming in 1.2). If you want - like we do - use SQL Server as a back-end; there are hoops to jump.

But the latest release is 1.1.1!!! This is a young framework.

Now, I have no idea what kind of project you are about to undertake. If it is something really, really large, I can't - based on my experience - allay any concerns about scalability. Maybe this talk by Carl Henderson might give you some visibility there... But the talk is probably a bit dated by now...

Finally, seriously, with a beautiful mascot in a great color scheme, what is not to love?


Edit: For someone coming from Java, with its .war files and tomcat; deploying Django sites is a pain in the proverbial arse. I know Python is awesome, but maybe we could depart from Python here and just mimic the ease of deployment that Tomcat provides?

celopes
While the talk by Carl Henderson starts more amusing than useful, it does discuss some scalability topics by the end. Stick with it. :-)
celopes
+1 for the Django Pony
Matt Baker
+4  A: 

Given a choice between Java and Python/Django, I chose Python & Django.

  1. Our requirements were approximately 3 versions of one PowerPoint slide. Which was wrong.

  2. I expected dramatic, unplanned, unforeseeable, devastating changes to the application with alarming frequency. Duck typing is essential to responding to devastating change.

  3. I could not imagine how we would manage this kind of dynamic development environment in Java/Tomcat, etc. I could imagine handling it in Python using Django. Django's DRY approach makes life quite simple.

  4. We had to build fairly complex and secure web services without any concrete requirements. Each draft was going to be a new experiment. Django supported this nicely because it is essentially a RESTful engine with support for JSON.

Only Python and Django can support this kind of "immediate response to change" ad-hoc software development.

S.Lott
+2  A: 

I'm not sure that you can reasonably compare Django and ASP.NET. With Django there's no alternative to a deep knowledge of HTML and, if you want browser based functionality, Javascript. ASP.NET will let you avoid a good deal of that knowledge if you like using web forms design.

On the flip side, with Django's ORM you don't need to know too much about SQL databases since you're not going to be interacting with database directly.

I did one project in Django and was impressed with the documentation, quality, and scope of the product. Unfortunately, I was using .96, and a number of breaking changes were introduced in version 1.0.

Larry Lustig
But ASP.NET has LINQ (provided you're using MSSQL) which is a pretty nice ORM technology. One of the things Django has that is a big advantage over ASP.NET is the auto-generated Forms. IMO coding ASP.NET I got sick of typing in "controls" onto a page by hand and then parsing each one on the code-behind.
T. Stone
+2  A: 

Last year I worked for a large Seattle company that does streaming media on the Internet. One of the things I wrote for them was a REST web service, and I used Django.

I had a completely positive experience with Django, start to finish. The documentation is excellent (The Django Book was great!) and it was easy to get started. I also really liked the Django ORM; you don't even need to know how to write the create statements to build an SQL table, the ORM can do even that.

The application just worked. It was rock solid stable. I had a prototype running for months on an underpowered old computer, and it never fell over due to memory leaks or for any other reason.

The final service had multiple servers in a cluster. As recommended in The Django Book, I used memcached to speed up the most common queries. The servers were lightly loaded by the service, and the service could have run on older/slower servers if it had been necessary.

I'm not much of a fan of SQL. It was great to be able to write a for loop or even a list comprehension in Python to pull records from the database, to tally up some statistics, or even clean out some records for development or debugging purposes. And the admin interface is a real plus as well.

That was the first production Python application at that company, but I wouldn't be surprised if Python/Django got used for something else there in the future, because the project was a success.

I recommend Django without hesitation, especially if you are already a Python fan.

steveha
+2  A: 

As for me, django is a perfect fit for startup because

  1. So little to start with
  2. Comprehensive documentation
  3. Many built in component a.k.a reusable application
  4. Takes less hardware resources
  5. Built with python
  6. Supportive and vibrant community
jpartogi
+1  A: 

For me (as a solo hobbyist/part-time developer) building a relatively complex scheduling app for my organization the critical benefits offered by Django are:

  • Awesome community (#django, mailing lists)
  • Incredibly well documented with ancillary materials (DjangoBook)
  • Python, python, python
DrBloodmoney