48 Comments
- karmakillernz, on 10/12/2007, -1/+13I've tried Django a few times over the past 4-5 months, and while overall it's pretty good, there are a few things which will stop me using it:
1) "Manipulators" - they're horrible. I *much* prefer the Rails way of validation being set in the model and always being used, no matter which way you access the model. What's the point in having validation if you can skip it by forgetting to use a manipulator? This is a case of loose-coupling taken too far IMO. Luckily the Django dev's are changing this for 1.0.
2) The template language. Not so much the language itself, but the fact that it's too difficult to extend to do something that's not already included. I prefer how Rails does this with ERB (embedded Ruby), but Python wouldn't be a great fit for this due to the whitespace-matters syntax (which I actually like). You can swap out the template language for any other one if you want so it's not a huge deal though.
3) get_absolute_url() - This makes me quake in my boots. I really hope they come up with a system similar to Rails' helpers (url_for) where it can work out what link to create automatically without having to specifically assign it in the *model* of all places.
That said, there are a few things which I love about Django (and Python):
1) Speed. Python is *fast* and Django was built for performance too, so the whole package just screams. Rails feels quite sluggish in comparison, which is understandable due to it's very dynamic (and introspective) nature, but Ruby itself doesn't help matters any. The next major release of Ruby is supposed to run on a VM so I hope that helps somewhat.
2) Native Unicode (UTF-8) support. Ruby doesn't support this (and won't until 2.0) and therefore Rails doesn't either. While Django doesn't have explicit support, Python does and therefore Django benefits if you want it to.
3) The URL-dispatcher. Rails has routes, but Django's URL system sits better with me and feels more flexible. You don't have to create a "welcome" controller just to display an index page - have the url dispatcher just render the template automatically. Not a huge issue though.
Overall it's good to have more choice in the web-framework area as it means we can pick whichever framework we feel best using and know it'll help us pump out those cool web-apps in no time flat. I'll be sticking with Rails for the meantime but will be keeping a close eye on Django in the future. - GoodBrain, on 10/12/2007, -0/+11Nice!
Very cool that they've documented which APIs are stable now (most of them), and which will still be evolving before the 1.0 release. - UncleOxidant, on 10/12/2007, -1/+9Nitro is a similar web programmig framework for those who like Ruby but not Rails. Check out Nitro at http://nitroproject.org
Nitro and Django are probably more similar to each other than to Rails. Nitro makes it quite easy to add an admin interface to your app for example (as does Django). Also, Nitro maps standard Ruby objects to SQL tables and not vice versa (again, more similar to Django than Rails). - philz, on 10/12/2007, -1/+7Ultra Fast Prototyping. (=> Meeting deadlines.)
- infradead, on 10/12/2007, -0/+6i440, the key is: you don't need to learn Python, but when you do it's pretty easy.
I think it's a strength of Django that it works hard for you, but gets out of the way when you want it to, exactly like a decent butler would. I'm currently building a news site for a client which involves in-browser editing of articles, etc. Consider that I pitched Django to this guy only three weeks after I started using it, you'll understand I'm very confident it's a fantastic tool. It makes web programming accessible to non-programmers and (for old skool perl hackers like me) makes life much easier.
So, if anyone reading is bedazzled by the array of web frameworks out there, I would strongly urge you to go through the superb Django tutorials:
http://www.djangoproject.com/documentation/
The two great things about Django are the framework, and the docs ... and Python itself. The *three* great things about Django are the framework, the docs and Python ... and ruthless efficiency ...
There, it's not so bad when you get the hang of it ;-) - happyfappy, on 10/12/2007, -2/+8Python is cool -- I would choose it over PHP or Perl any day -- but if you're into OO or Metaprogramming, you really should consider Ruby instead.
In Ruby, absolutely everything -- even primitive types like integers -- are objects. Every command is a message sent to an object. - litespeed59, on 10/12/2007, -0/+6I notice you are using RadRails for Ruby, which is Eclipse based. I use Eclipse 3.2 with the WST and PyDev plugins for working on Django code.
PyDev is available at http://pydev.sourceforge.net/ - infradead, on 10/12/2007, -0/+6I'd recommend installing from SVN:
http://www.djangoproject.com/documentation/install/
Then just do an "svn up" whenever you need to upgrade. Took me 60 seconds tonight :) I'd hate anyone to get the idea this is awkward to install or anything; it really isn't. - holovaty, on 10/12/2007, -0/+6Regarding get_absolute_url() -- I've already checked in some code that removes the need for it. The changeset is http://code.djangoproject.com/changeset/3472 , and it's not documented yet, but essentially there's now a function decorator called permalink() that you can add to any function or method. Your method is responsible for returning the view name and URL parameters, and permalink() will do the reverse URL lookup according to your URL configuration. This'll be documented in the coming days.
- vonnie, on 10/12/2007, -0/+5I don't know python either, but I can still dabble somewhat in django. You can learn python 'on the go', and still do interesting stuff with django. Generic views and the standard admin interface really help.
- CoolGoose, on 10/12/2007, -1/+6Now we have an official release of the magic removal branch ;)
- happyfappy, on 10/12/2007, -0/+5I agree with pretty much everything you said.
I would add, however, that although Rails isn't as fast as Django, speed is rarely the limiting factor with a Rails application. In my experience, the hard part is deploying a Rails application -- specifically, finding a web host that will support Rails and that will support it well. I suspect that getting Django to run reliably on a web host is only more difficult.
So in a nutshell: if you're serious about deploying a web application, I would lean toward Rails over Django for the simple fact that it's been used more often and it has broader support among web hosts. At the very least, if you're going to go with Django, I would look for people who have gotten web applications to run on that framework -- preferably with more traffic than you expect to get -- and then find out what web host they've been using.
I recently deployed my first web application on Rails. Developing it was a snap. Deploying it was not so easy. Once it started getting over 2000 page views a day, it started going down constantly -- as in, huge glaring 500 Internal Server Errors, never to come back up again until being manually restarted or restarted via a Cron job.
I tested the app like crazy, and couldn't find any problems. I profiled the code, and found nothing in the app that would explain such problems. Desperate, I redeployed the app on a different web host -- running Apache instead of Lighttpd -- and the problems disappeared. Since then, it's been getting around 10,000 page views and it hasn't gone down once.
The problem wasn't with the application, and it wasn't with the framework -- it was with the server and -- by extension -- the web host. Finding a host that would adequately support Rails wasn't easy. My guess is that finding a host to properly support Django would only be harder. - glenn1you0, on 10/12/2007, -2/+7python - it's like Perl without the cruft, like ruby without the cruft, like java without the cruft.
Plus throw in some awesome test frameworks and a documentation system.
It's been my experience that it gets you from problem to solution in about a half to one quarter the time of java, and in a form that is generally more readable than Perl or ruby.
And django just compounds the developer performance gains.
Good stuff. - Poromenos, on 10/12/2007, -0/+4There is no "Django" IDE, but for a Python IDE I like ActiveState's Komodo, I write all my code there.
- Herolint, on 10/12/2007, -0/+4Yes, we do!
I must say that this version is much better than the previous releases. I am very impressed with the APIs and tools available and their ease of use.
For the most part, the documentation for Django is very good. By working your way through the easy tutorials, and by reading some of the other documentation on templates, manipulators and the like, you can make an excellent, database driven, web site (its also great if you don't need a database).
The only thing I wish the Django team would do better is document the parameter lists for the methods they document. It kinda sucks to have to go rummage around in the code to see what parameters are required or available to a given method call. Putting it right there in the tutorials and documentation would be a huge step in the right direction, I think.
Other than that small criticism, I think Django is one of the best web frameworks to come along. It sure beats trying to do PHP, ASP, JSP, or any of that junk. There are other web frameworks available, but with the exception of Ruby on Rails, I don't think they come close to the productivity of Django. - adolfojp, on 10/12/2007, -0/+4I like to use IDEs instead of simple text editors. I like to have a nice package that has debugging capabilities, that will create a directory structure that I can navigate easily and some syntax highlighting and code completion if possible.
I use RadRails for ROR, VS Express for C# ASP.NET and Java Studio Creator for JSF and Java.
Could anyone recommend a Django IDE? - vonnie, on 10/12/2007, -0/+4Yeah, personally I really prefer having my properties in the code of my model instead of inspecting the database. It's kinda annoying that you have to check the database or some migration files to see what properties you have on a model. Opening the source code file should be enough to know everything there is to know about a model.
- Revolt25, on 10/12/2007, -1/+4nice to see people using python, ever since php got popular u havent seen it much, it is a great language, first major language i learned
- msbeckman, on 10/12/2007, -0/+3wow.... my team finally got Django up and running yesterday... then they release a new version... just my luck.
- zendak, on 10/12/2007, -0/+3SPE might me what you're looking for: http://www.stani.be/python/spe
- fsapo, on 10/12/2007, -0/+2I just hope they add Firebird support in the official release, its a great database.
- i440, on 10/12/2007, -0/+2Sounds good. I will download it. If anyone else would like to try it, www.python.org or reboot into whatever Linux distribution you may have (it seems to be included on many of them). If not, your package manager would love to be of assistance.
- dtfinch, on 10/12/2007, -0/+2I've barely touched python, but already I feel like I can do anything with it. It makes it easy to write very short, readable programs. It mops the floor with php in most benchmarks, and there's even an easy to use dynamic compiler called psyco.
I'm still looking for a Linux IDE that's as easy and featureful as pythonwin though. - newtonapple, on 10/12/2007, -0/+2If you use Mac. Try Textmate (not free). Yes it supports things other than RoR. It's not really a complete IDE (like lacking a debugger). But for text editing, it's really nice. You can download the Django bundle for Python and it also has a PyChecker or PyLint hook. Tab(auto)completion will save you tons of typing when doing templates or actual Django codes. And you can add your own Tab completion really easily if you find something missing. It's definitely one the best text editors out there.
- JEmerson, on 10/12/2007, -1/+3I'd second that recommendation for eclipse and PyDev. It's really nice, from what I've seen. Even better, it's nice 'and' crossplatform.
- zootm, on 10/12/2007, -0/+2"i mean google runs on python, right?"
Google has some tools running in Python, but don't think that all of their systems run on Python. They use a wide variety of languages and tools. It is a fantastic language for getting stuff done quick and keeping it maintainable.
"hmm i was considering php before, but i dunno"
PHP's primary advantage is its ubiquity. Good coding is possible in PHP, just harder (especially using versions prior to 5). I'd definately learn Python over PHP unless you need something that you can host on generic webhosting (Python hosting is far harder to find than PHP hosting, for a variety of reasons). - zootm, on 10/12/2007, -0/+2happyfappy:
I kinda agree with that, although I prefer Python for its layout enforcement and things like that. In my experience, Python and Ruby are generally equivalent, although more general-purpose libraries are available for Python, and I find it easier to read (the English-y nature of Ruby kinda works against it in my head, but that's possibly/probably just me). They're both fine choices - it's largely a personal choice. - chubbymidget, on 10/12/2007, -0/+2This project was mentioned the other day (directly or indirectly I don't know) but it was the first I'd heard of it. It looked very interesting but it didn't look possible, from the directions and forums, that it was possible to install on a hosted/VPS server.
If anyone has any insight on this I'd be interested. - zootm, on 10/12/2007, -0/+2Thirding the recommendation for Eclipse/PyDev for Python development, although I've not specifically used Django. As for ActiveState Komodo, I believe that's not free, but if you've got the money to spend I've heard good things about it.
- ungamedplayer, on 10/12/2007, -0/+1Just out of interest, what makes it a great database ?
- infradead, on 10/12/2007, -0/+1I would recommend finding yourself some virtual-hosted Linux system, if possible. I just switched to a2b2.com who seem (after about a week) very good, but they're not the only ones available. Otherwise, FastCGI might be a solution:
http://www.djangoproject.com/documentation/fastcgi/
I've had a few hosting providers over the last few years, and finally went for the virtual server solution after spending a long, long time trying (and failing) to install some Perl CPAN modules on my Yahoo system. Now, I can't see any benefit to traditional hosting: I have root access via SSH to my server, and can install whatever the hell I like, be it RoR, Django or whatever else I feel like trying out. I also set up a separate account for my web designer to upload templates, etc, rather than having to share my main password. So if anyone's thinking "I'd like to use this, but my hosting provider won't do it" -- take control, go virtual :) - eelco, on 10/12/2007, -0/+1And while you're at it, you might want to give Pylons (http://pylonshq.com/) a try. I must say i prefer Django, though.
- itanshi, on 10/12/2007, -3/+4IANAP(rogrammer) but eh with how much i do know, this looks fairly easy to code. almost makes me want to try it out.
i mean google runs on python, right? hmm i was considering php before, but i dunno - trypnotic, on 10/12/2007, -1/+2@vonnie
Actually, in Rails, you can set properties in the model code as much as you want, and it's easy to do. Just because you CAN use ActiveRecord's handy db inspection doesn't mean you have to. - ubernostrum, on 10/12/2007, -0/+1Django's got JSON; simplejson is bundled, and there's a built-in serializer for translating Django model instances into JSON (there's also a serializer for XML).
Bundling a JavaScript library is something I'm not so much a fan of, and though I've taken some heat in the Django community for that, I stand by it.
As for "intuitive and easy to use", well, different things suit different people; there are even people who find Perl "intuitive and easy to use". Use what works for you. - sashomasho, on 10/12/2007, -0/+1It's strange that nobody mentioned TurboGears, these days I've spent a lot of time learning both, and I know this is django news, but let's put some light on its main alternative for many python programmers stepping into the web world. IMO TG is much more intuitive and easy to use, of course it misses some of the great apps (as a matter of fact the whole idea for apps in a TG project is missing, or at least the things are not so pluggable) like admin, but there are many other features that make it superior to Django. There is already an embedded JSON support in it, the JS library MochiKit is very easy to use and there is of course much more. Django is nice, and it deserves giving a try, but don't pass by TurboGears without tasting it..
- ubernostrum, on 10/12/2007, -0/+1I've used Django on everything from shared hosting up to small clusters. What was it that gave you the idea it wouldn't work on a VPS?
- karmakillernz, on 10/12/2007, -0/+1Thanks for the reply Adrian. I knew you guys were working on a more elegant solution to get_absolute_url(), I just didn't know you were so close! I'll keep an eye out for the documentation.
Once the validation framework changes (manipulators, etc) are figured out, I'll definately be using Django for future projects. I'm looking forward to it... :) - stuhood, on 10/12/2007, -0/+0RE: msbeckman
You guys really should have read more carefully on their website: All of the documentation they have had up for the last few weeks referred specifically to this new branch of the code. There are some significant changes to the api, and if you plan on using it for a large project, you should probably bump your version to .95 before you write too many lines. - boxabirds, on 10/10/2007, -0/+0Useful thing to put into the mix here is around Streamlined -- an autogen admin framework for rails: www.streamlinedframework.org -- I've played around with it and with a line of code per model object (acts_as_streamlined) you're away. I'd not be surprised to see some derivative of streamlined become part of core rails some time in future.
- nirvdrum, on 10/12/2007, -0/+0A lot of people like to just run a point release to avoid the headache of different people in the development team running different versions of the framework based on when they svn updated. This goes for matching the production environment with the development one. This was all brought up in a recent thread on the dev list, and I'm glad to see the devs responded.
Additionally, if you don't use svn for your own work, it's not really clear to me that setting up svn saves you a lot of time here *shrug* - TomCherry, on 10/12/2007, -0/+0http://3couleurs.blogspot.com
- mydave, on 07/26/2008, -2/+0It's pretty nice. now all process will be faster and easier.
http://www.ocflex.com/
http://www.trgovinca.org
http://www.chasr.org/ - i440, on 10/12/2007, -11/+9Python devs, convince me why I should learn Python. I don't know that much about it.
*sets timer* and...GO! - int19h, on 10/12/2007, -10/+7@i440
It's arrogant to demand that people should convince you why you should learn Python, and especially demanding this from the Python developers. The world does not exist for your sake. - yogastore, on 06/30/2008, -3/+0http://astore.amazon.com/flowtron.mosquito-20
http://astore.amazon.com/flowtron.insect.killer-20
http://astore.amazon.com/evaporative.air.cooler-20
http://astore.amazon.com/air.swamp.cooler-20
http://astore.amazon.com/braun.electric.kettle-20
http://astore.amazon.com/cordless.electric.kettle- ...
http://astore.amazon.com/canon.battery.charger-20
http://astore.amazon.com/12.volt.battery.charger-2 ...
http://astore.amazon.com/furniture.chaise.lounge-2 ...
http://astore.amazon.com/outdoor.chaise.lounge-20


What is Digg?
Browsing Digg on your phone just got easier with our enhancements to the