Discover the best of the web!
Learn more about Digg by taking the tour.
Develop for the Web with Python Django Web Framework
ibm.com — In this first article of a two-part series, we show off Django, an open-source model-view-controller (MVC)-style Web application framework powered by the Python programming language. With Django, you can create high-quality, database-driven Web applications that are easy to maintain in minutes.
- 543 diggs
- digg it
- BioCS.Nerd, on 10/12/2007, -1/+9Thanks for the link. I really love IBM's developer site. They seem to cover a wide variety of topics with enough depth to really pique one's interest.
- lazaridiscom, on 10/12/2007, -4/+0"They seem to cover a wide variety of topics"
I don't think they cover enough topics.
A few missing one, like basic Project Organization, Community etc. are covered here:
http://case.lazaridis.com/wiki/DjangoAudit - ubernostrum, on 10/12/2007, -0/+2Yes, Ilias, I do pray you'll forgive us for thinking that a useful, working product is more important to have than an org chart.
- arctic, on 10/10/2007, -0/+1*pick
- lazaridiscom, on 10/12/2007, -4/+0"They seem to cover a wide variety of topics"
- tehrit, on 10/12/2007, -0/+9Django is one of the best frameworks I've ever worked with; a solid ORM, little-to-no 'magic' that makes it hard to puzzle out what's going on and a good template language (e.g. it's not XML).
Further, it manages to be incredibly powerful without getting in the way.- Herolint, on 10/12/2007, -0/+3I completely agree. I've created a few sites for our intranet using Django and have loved every moment of it. Thanks Django people!
- asmodai, on 10/12/2007, -2/+6Make sure to check the latest Django documentation. __str__ is preferred over __repr__ nowadays.
Other than that a wonderful article.- imaurer, on 10/12/2007, -0/+0The fix has been made to the article by IBM. The best practice change of using __str__ instead of __repr__ is a change I didn't catch previously. Thanks for the heads up! - Ian
- lazaridiscom, on 10/12/2007, -12/+0Another kind of review: http://case.lazaridis.com/wiki/DjangoAudit
- ubernostrum, on 10/12/2007, -0/+7And another view of your review:
http://groups.google.com/group/django-developers/browse_frm/thread/eeb67f26e799f6f9
- ubernostrum, on 10/12/2007, -0/+7And another view of your review:
- infradead, on 10/12/2007, -0/+8Django totally rocks, and I'm saying that as someone who hadn't programmed either Django or Python until about four weeks ago. I'm creating some new web-based apps for work, and also (I hope) about to pick up some freelance work based on pitching Django to the client. It's ridiculously easy to use, and suitable for non-hardcore programmers. Good tutorials available at http://www.djangoproject.com/.
- Z_Man, on 10/12/2007, -3/+5heh. how odd? i actually started using django a couple days ago.... works really nicely
- Sferrero, on 10/12/2007, -2/+5Gosh, I'm so torn between this and Ruby on Rails!!!
- Bishoco, on 10/12/2007, -2/+5I'm way too invested in Ruby on Rails at this point.
- sbrown123, on 10/12/2007, -3/+9@Bishoco - Oh, what the heck did you invest in RoR? You buy a bunch of books? Have a T-shirt that says "I Love Rails"? Where is you sense of adventure? You took the leap to Rails so why not jump that bridge a few more times?
- arctic, on 10/10/2007, -0/+1ROR FTW!
- JonGretar, on 10/12/2007, -5/+5You can only jump so and so many bridges at a time. :)
I tried to like Python. I really did. I just didn't accept that whitespace thing. I see how some people like it but it just isn't me. - leftwing, on 10/12/2007, -2/+11@JonGretar "I tried to like Python. I really did. I just didn't accept that whitespace thing."
Hmm, I'm sorry, but this just doesn't ring true to me. How much python did you write, trying ever so hard to accept "that whitespace thing"? I would guess very little to none, because when you actually program in python, the significant whitespace simply isn't an issue. You just indent as you normally would with any other language, and it works.
Sorry if it seems like I'm picking on you, but I get tired of this dismissal of a great language for such silly reasons. If you don't like python, it doesn't fit your brain, you like something else, then that's perfectly fine. It can't be everything for everyone. But to dismiss it because of "that whitespace thing" is really just silly. - JonGretar, on 10/12/2007, -5/+2@leftwing
Of course the whitespace wasnt the only problem for me. And I kinda almost liked it but I just liked Ruby better. Regarding the whitespace it just bugged me. I know it's not a big issue and it shouldn't. But it was just a little thing picking on me. - JonGretar, on 10/12/2007, -3/+1Oh... And if you like whitespaces... http://compsoc.dur.ac.uk/whitespace/
;) - dasil003, on 10/12/2007, -1/+4I prefer Ruby to Python, but I'm torn because Python is so much more mature with unicode support and more libraries. The momentum behind RoR is the tie breaker for me. I'm going to master Rails inside and out so that I can make a more informed opinion later. I'd hate to spend a few days with a bunch of different frameworks and make snap judgements based on superficial understanding. Better to identify the promising frameworks and spend the time to really master them before making a definitive decision. How many people are experts in both Rails and Django? Not enough I think.
- Bishoco, on 10/12/2007, -0/+3@sbrown123 I've invested a lot of time and effort into building a web application using Ruby on Rails. I have a very small ROR app running right now and I have a much larger one about 75% done.
But, I don't mean say I'm unhappy with Rails. For me, it's been as easy and as fun as people hype it up to be. It's just I don't have the time or thee energy to learn a new framework. - Bogtha, on 10/12/2007, -0/+2> Oh, what the heck did you invest in RoR? You buy a bunch of books? Have a T-shirt that says "I Love Rails"?
You've got to be kidding. How about when you've got significant amounts of code built around RoR? There's more to programming than buying t-shirts.
Maybe when you're in university or you're a hobbyist, you can jump to new languages on a whim, but do that when you need to actually be productive, and you end up with a spaghetti mess of all kinds of different systems all trying to work together, or you end up trapped in constant rewrites and never get anything done. - JonGretar, on 10/12/2007, -0/+5@Bishoco:
I understand that you are invested in RoR. But try to invest yourself in Ruby instead. I have found myself doing stuff that RoR was maybe too much of a framework to do. Not gonna go into examples but it's totally worth checking out Nitro as well (http://www.nitroproject.org). If you focus on knowing Ruby instead of just RoR you will find that Nitro is a good tool for some jobs since you can make a small single file app in that.
- HardBap, on 10/12/2007, -1/+4How does Django compare to TurboGears?
- Sferrero, on 10/12/2007, -0/+3Django, TurboGears, RoR... They all seem really good, It's going to be hard to decide. What does everyone think of the three?
- ubernostrum, on 10/12/2007, -0/+6HardBap, they're both MVC Python frameworks; the biggest difference is that Django started out several years ago as an in-house project, at a time when there weren't solid freely-available components which could be rolled into a framework, so the various parts of it were all written from scratch.
TurboGears, on the other hand, is of much more recent origin and is really more of a "glue" tying together several popular independent projects -- Kid, SQLObject, etc.
Both have strengths and weaknesses; probably your best bet is to read the available documentation for each and check out the mailing lists and IRC channels if you have specific questions. - holovaty, on 10/12/2007, -0/+15The main difference is that Django is a nicely integrated full-stack package, whereas TurboGears is a collection of already-existing disparate pieces. This gives Django all sorts of subtle advantages such as the fact that all the documentation is in one place, the various levels of the stack are conveniently integrated (but not tightly coupled), and it just works better as a nice, clean, integrated system.
Beyond that, though, in my opinion the TurboGears pieces aren't really up to snuff -- I can't stand the CherryPy API (Global objects? What?! Not differentiating between GET and POST? What?!), and I strongly dislike XML templating systems such as Kid (which is also quite *slower* than Django's text-based template system). Granted, template systems are an intimately personal preference, so you should use any template system you can and see which you prefer; it's easy to use any template system with Django, as long as it's written in Python.
Plus Django comes with *many* conveniences -- the automatic admin interface must be seen to be believed. It's Django's crown jewel and has probably saved me *months* of man hours reinventing admin interfaces.
As a final note, Django has been used on high-traffic sites for almost three years. It's damn fast, and it comes with a fantastic caching system. It's been quite effective in my using it at washingtonpost.com, where the servers' loads are almost perpetually at 0.01.
(Note that TurboGears fans like to say "It's nice to reuse existing pieces because of loose coupling." Well, Django is just as loosely coupled -- and I daresay it's even *more* loosely coupled than TurboGears. For example, it's stupidly easy to use another template system with Django: You just use it. In TurboGears I believe you have to write a template-system adapter.)
Full disclaimer: I'm a Django developer. - altjeringa, on 10/12/2007, -0/+3Django is a full stack in and of itself, everything in Django is written by the Django developers. The ORDBM, the templating system, the engine.
Turbo Gears is an engine which binds together other Python Modules, SQLObject, Kid, and CherryPy being the most notable.
The are both pretty nice. Django doesn't have any built in JSON support. TurboGears feels more "hands off the code."
Also might be worth looking at http://www.webwareforpython.org/ if you are interested in python frameworks. - ubernostrum, on 10/12/2007, -0/+1altjeringa: no JSON support?
import simplejson
There. All done ;)
Sure, we've got our own stack for ORM, views, templating, etc., but at the time that was a necessity. These days there are good tools for Python that make it unnecessary to reinvent the wheel. - asdren, on 10/12/2007, -0/+3Adrian, aren't you _the_ Django developer ;)
- jcroft, on 10/12/2007, -0/+3Adrian is one of MANY Django developers (it's open source, after all). He's one of two lead developers. He's also one of two Django creators. But it's not really accurate to say he's THE Django developer, no.
- sbrown123, on 10/12/2007, -5/+3Is there really that huge of a market for these "instant web sites". You know, like Ruby on Rails and such where you just need to add water and your done in minutes? What happens when you want to do more than a basic (and I mean basic) CRUD app and find out that the instant framework is really just a bunch of smoke'n mirrors on the inside?
- jdunck, on 10/12/2007, -0/+6I'm not an expert on the other frameworks, but I think you'll find Django has no smoke and nearly no mirrors. ;-)
- ubernostrum, on 10/12/2007, -0/+2Check out ljworld.com. Django-powered. Ditto a number of features at the Washington Post and quite a few other news/media sites of varying market size.
Smoke and mirrors this ain't ;)
More reading: http://code.djangoproject.com/wiki/DjangoPoweredSites - sbrown123, on 10/12/2007, -0/+1@jdunck - Oh, for love of Python I'll give it a look at. Languages like Python and Ruby are awesome but I keep hating these frameworks that claim they will do everything but usually don't. Probably a lasting effect of dislike for Microsoft's "web" technologies....
- Mooseknuckle, on 10/12/2007, -0/+3I'll have to agree ... I solid home-grown web-app architecture is worth the solid investment. And I use the term home-grown loosely. I work in what is probably the least popular modern web-app development environment (LAMPerl), and we have done wonders using perl's built-in modules like:
Class::DBI
App::Dispatch
Apache::Request
CGI::FormBuilder
Template-Toolkit
Class::Accessor
etc ...
I dont want all those zany config files to fuss with. I did JBoss for about 2 years, and really got sick of the configuration, and waiting for the "hot-deployable" infrastructure that we were promised for so long to manifest. I'm glad to be away from all of that wysiwyg webapp bull. - paching, on 10/12/2007, -0/+2Django is great for both basic stuff and large projects. You can use as much or as little of it as you like, and the option of, say, writing your own SQL queries manually is always there if you want it. Even quick-'n-dirty custom pages are a cinch when you need them. But the database abstraction and data model/view/template separation makes it very flexible and maintainable for the future. It isn't really so much of a framework; there's only a very few files generated and you can easily do it your own way if you want.
- JonGretar, on 10/12/2007, -0/+5@Mooseknuckle:
RoR only has one configuration. Where the database is. I think the same story is for Django.
Remember that RoR and Django are just little addons to a full programming language. You still do everything in Ruby or in Python. Someone has just made a few shortcuts for the most common things. - codahale, on 10/12/2007, -0/+3See, this is a marketing problem with web frameworks. There's no "just add water" part of Rails; Rails (and Django) just makes life easier by combining all the stuff you *should* have been doing but never really got around to (unit tests, MVC separation, humane URLs, etc.). You still have to make a web application, you just don't need to write an ORM, a templating system, a URL mapper, etc. etc. before you can get to that. It's the difference between having to build a kitchen before making a cake and just showing up with some flour, sugar, and eggs.
I'm about to go live with a Rails app which doesn't do a bit of CRUD (well, it Reads, yeah) and it's been a blast. I've got 100% C0 coverage with my unit tests (thanks to rcov), a *really* nice deployment system (thanks to Capistrano), and when I felt hindered by the framework... I wrote a plugin, and changed its behavior. I (heart) dynamic languages. - foobario, on 10/12/2007, -0/+3I started using RoR a few weeks ago, with only PHP and Visual Basic for prior experience, if you can call it that. The intro videos are a little misleading, because they show how easy it is to develop a CRUD blog and imply that everything is that easy... it only stays that easy if all you want is a CRUD blog.
But I read a book and worked through some tutorials and talked with folks on IRC, and now I'm rewriting all of my old PHP stuff in RoR. The ORM and presentational stuff in RoR has reduced my code size by a factor of 20. For business logic it's still perhaps a factor of 5, and it's a lot cleaner. Weird database stuff that doesn't have some established RoR voodoo (or that I don't know how to do in RoR yet) just gets copied right across with minor tweaks.
I haven't noticed much in the way of smoke and mirrors... usually it's just my vision that is cloudy. YMMV.
I looked at Django as well, and only chose RoR because Ruby appealed to me more than Python. This is obviously pretty subjective, and not indicative of the relative worth of the two languages. I think that (in programming or anything else) the value of a tool has a lot to do with how comfortable the user is using that tool... use whatever tool makes you work well. - ubernostrum, on 10/12/2007, -0/+2codahale, I think that's the best description of the advantages of a good framework that I've ever seen. I may have to start quoting you ;)
- ericmoritz, on 10/12/2007, -0/+1ubernostrum: Don't forget my site :) http://www.naplesnews.com it's on Django too How's it going btw :) Represent #django on freenode!
We just released this http://www.napesnews.com/affordable_housing/database/ in Django (Corperate IT gonna hate me for posting that to digg)
- Mooseknuckle, on 10/12/2007, -9/+1If I can't pronouce it, why should I use it? If developers can't make saying the name of their damn framework possible, just imagine how terse the implementation must be!!!
- ericmoritz, on 10/12/2007, -0/+2That's Jango the 'D' is silient :) Named after Django Reinhardt the Jazz Guitarist (Adrian is a Jazz nut have you heard his Mario 2 rendition? I think that was dugg a while back)
- rasterbator, on 10/12/2007, -1/+1Is this easier than Ruby on Rails?
- jdunck, on 10/12/2007, -1/+3Depends what you need to do. Rails is all about convenience for building app-y stuff. Django is more CMS and content-y. They're both good. What's easy to you?
- ubernostrum, on 10/12/2007, -1/+2Though, to be fair, there are plenty of people doing "app-y" stuff with Django. I know there are a couple of social-networking sites built around it, and I just saw a new photo-sharing site pop up recently. I'm pretty sure they're listed on the Django-powered sites page I linked above.
- arctic, on 10/10/2007, -0/+1http://www.pownce.com
- jcroft, on 10/12/2007, -1/+0Yeah, I don't think it's very fair to say that Rails is more app-y than Django. What, exactly, is Django missing that Rails offers for creating web "apps"? Having not used Rails, I don't know the answer. There may be a thing or two -- but I think it's safe to say that any web app you can create with Rails, you can create with Django, as well.
I do think, on the other hand, that Django offers a LOT for content-heavy sites that Rails doesn't -- such as a feed framework, an awesome admin interface, and a template language that simply rocks for designers (who are usually involved in content-heavy sites).
Rails came out of a real-world project that is "app-y" (Basecamp). Django came out of a real world project that is content-heavy (lawrence.com). Where they may be some evidence within each of their roots, there's no question in my mind that you can build either type of site with either framework pretty damn easily. - jeremymcanally, on 10/12/2007, -0/+0[q]I do think, on the other hand, that Django offers a LOT for content-heavy sites that Rails doesn't -- such as a feed framework, an awesome admin interface, and a template language that simply rocks for designers (who are usually involved in content-heavy sites).[/q]
Ermmm...get a plugin for the feeds, use scaffolding for the "admin interface", and scrap the template language -- Rails doesn't need it. eRb lets you embed Ruby into HTML a la PHP (or you can download a template language plugin if that's your flavor). - dehora, on 10/12/2007, -0/+0I think so, yes. There's the admin app, easy url management, the templating system, inspectdb, working solely with objects and not tables.
Personally I don't buy the app v cms line - but at least it stops the two comunities going at each other. Fwiw, all rdbms backed systems have the problem of dealing with arbitrary content types and metadata - this is where something like Zope/ZODB/CMF really shines. - ericmoritz, on 10/12/2007, -0/+1A buddy of mine built http://www.gmapme.com in Django with is a "App-y" kinda site. Chicagocrime.com is an App-y kinda site. That is if I'm understanding the definition of "App-y" correctly.
- jcroft, on 10/12/2007, -0/+1"Ermmm...get a plugin for the feeds"
I didn't say you could do this stuff in Rails -- I said it's not built-in.
"use scaffolding for the 'admin interface'"
If you are seriously comparing scaffolding to Django's admin interface, you clearly have not used it. Django's admin interface is a beautiful, polished, FINISHED front-end to your app that is ready to be USED to end-users. Scaffolding is a start in the right direction that you're supposed to replace/enhance with your own code. The two have almost nothing in common. Scaffolding is much more like Django's CRUD generic views than it is like Django's admin interface.
"and scrap the template language -- Rails doesn't need it. eRb lets you embed Ruby into HTML a la PHP"
Which is about the worst possible thing I can imagine for designers. You expect your designers to know Ruby? Or Python? Or even PHP? And giving designers access to a full programming language in the presentation layer? Talk about a breaking of your MVC setup waiting to happen! Template languages are great for designers, which is who they're aimed at.
And yes, I know there's Liquid for Rails (which is a port of Django's template language, by the way), and it's great. But, it's still not built-in, which was my point.
The point that you clearly missed was that while both frameworks are great for content-heavy sites, Django has more of the tools you might want BUILT-IN.
Django's built in comments app is another example of this that I forgot to mention, by the way. - jdunck, on 10/12/2007, -0/+0@jcroft: Just so we're clear, I like django and I'm aware of what it can do. :)
Rails does offer some convenience methods for app dev at the cost of some coupling. Yes, you can use Django to do pretty much everything Rails can do. I just meant to highlight the sweetspot for the two.
And to that guy saying dj admin is like rails scaffolding. Phththpt. Try the dj admin. It is nothing like rails scaffolding. - jcroft, on 10/12/2007, -0/+1"I just meant to highlight the sweetspot for the two."
Makes sense. Having never actually used Rails for a project (I've played around with a bit is all), I don't know from experience. But, I'm sure you're right. :)
Unfortunately, it's not a situation where most of us can "use the right tool for the job" on a given project. Most of us aren't going to learn Rails and Django both and use one when we're doing something app-y and one when we're doing something content-y. Most of us are going to pick one or the other. I think the primary deciding factor is going to be whether you prefer Ruby or Python. It's probably fair to say that secondary deciding factor may be if you spend all your time doing one type of site (app-y or content-y), then one might be more appropriate than the other.
Like I said, you're probably right about the sweet spot. I just think Django sometimes gets the "it's for content, Rails is for apps" thing thrown at it as a criticism, but I don't think it's a fair or accurate one at all.
- Irimi, on 10/12/2007, -0/+4Do anyone have a frame of reference to compare this to CherryPy?
- jcroft, on 10/12/2007, -1/+1Yeah, Drupal is a CMS, right? Neither Django nor Rails is a CMS (although Django's automatic admin interface makes it possible to use Django as a CMS with almost no real programming). They are web application building frameworks.
My understanding (although I haven't tried them) is that there are some MVC-style frameworks for PHP, but I've yet to see evidence of any of them "catching on." As a non-programmer looking on this from the outside, it seems as though the point at which developers realize that PHP is a pile of crap compared to Ruby and Python tends to about the same point at which they decide they should be doing things MVC-style. As such, most PHP developers are not using MVC concepts and most people who are using MVC concepts are not PHP developers.
Or so it seems.
- jcroft, on 10/12/2007, -1/+1Yeah, Drupal is a CMS, right? Neither Django nor Rails is a CMS (although Django's automatic admin interface makes it possible to use Django as a CMS with almost no real programming). They are web application building frameworks.
- uptown, on 10/12/2007, -0/+2How's django & python compare to what's out there for use with PHP?
- everbright, on 10/12/2007, -1/+1I'd also be interested in a comparison between django vs drupal (PHP based).
- jdunck, on 10/12/2007, -1/+2It's better.
No, seriously-- work through a couple tutorials. ;-) - DeadWisdom, on 10/12/2007, -1/+5PHP is like grunting and hand signals to Django's eloquent prose.
- JonGretar, on 10/12/2007, -0/+3@everbright:
no no no no.... Django and RoR are frameworks. Drupal is a finished system that has some plugin capabilities and so on. You don't compare them together because RoR and Django are used to create things like Drupal. Comparing them would be like comparing a hammer to a house.
- clueless, on 10/12/2007, -1/+1could someone help a newb...
so you copy and paste these stuff:
~/downloads# svn co http://code.djangoproject.com/svn/django/trunk/ django_src
~/downloads# cd django_src
~/downloads# python setup.py install
in the python command line as it is and execute to get django? becuase i'm not getting anything.- jdunck, on 10/12/2007, -0/+1Nope, that's stuff for the command line.
Windows? You want this:
http://tortoisesvn.tigris.org/
*nix or Mac? You want this:
http://www.ceri.memphis.edu/computer/docs/unix/bshell.htm
then this:
http://subversion.tigris.org/
Do you know python at all? If not, I can dig out links. But Digg isn't the best place to get started.... - clueless, on 10/12/2007, -0/+1thanks
well i'm using "ActiveState ActivePython 2.4" for now (since i've just started).
now regarding resources, i do have bunch of links but who has the time to look at all of them. then again i'm trying.
- jdunck, on 10/12/2007, -0/+1Nope, that's stuff for the command line.
- Phoenyx, on 10/12/2007, -0/+5Adrian Holovaty (of Django) and David Heinemeier Hansson (RoR) talk about their respective platforms:
http://www.djangoproject.com/snakesandrubies/ - Kam3k, on 10/12/2007, -0/+1I could see myself using Django over Rails for certain projects having spent a few hours playing with it. But I'd be interested to know if the benefits of the automatic admin system disappear when you need a CMS with more advanced and possibly unique requirements. At what point do you end up having to just write the admin system for scratch or is it flexible enough that you should never need to?
For example if you needed content versioning and roll back, some kind of specialised rolls and permissions or any other kind of business logic in the admin system that goes beyond the crud screens that the beginner tutorials show you how to set up and customise.- DavidDigg, on 10/12/2007, -0/+1@Kam3k: Django was developed for a newspaper as you can hear about at http://video.google.com/videoplay?docid=-70449010942275062 (from http://www.djangoproject.com/weblog/). Newspapers have really simple business processes (write, edit, publish) and the accountability issues are minimal compared to, say, those of pharma companies. In fact our company makes a hybrid project management/CMS with the features you mention which resembles...well... Hypercard. Anyone remember Hypercard?
In the OSS world, it sounds like you want to check out Zope. Interesting fact: Zope corporation implemented a project for the US Navy. - JonGretar, on 10/12/2007, -0/+1I actually agree with David. Zope is one powerful package. Absolutely perefect for HUGE intranet sites like the US Navy inventory database.
Of course. That also means that it's not exactly the simplest thing out there. - jcroft, on 10/12/2007, -0/+1The answer to your question is pretty subjective. The admin interface is incredibly complete and very configurable, which makes it great for almost anything I can think of. But, I'm sure there are certain and specific apps that it's just not appropriate for, so you'd be writing your own. The answer, as always, is: it depends.
But my real response is: how can this possibly be a negative?
You're asking if the benefits of having automatic admin disappear at some point. Maybe they do. I think that point is WAY down the line, but maybe. So you're left with a framework that STILL offers a lot more than Rails does (auth/auth, internationalization, syndication framework, etc.).
I guess I just can't see how the fact that the totally optional admin interface MAY not work for you could possibly lean you towards Rails, when Rails doesn't offer one at all. - asdren, on 10/12/2007, -0/+3http://oodt.jpl.nasa.gov/better-web-app.mov caution - huge - 380 MB
this video has been posted at least twice here on Digg
it compares Rails, Django and Zope (and JSP/Servlets)
though it really isn't a fair comparison since Rails and Django are frameworks while Zope is more like a CMS/Portal. However Zope seems pretty awesome if you need a portal site. - jcroft, on 10/12/2007, -0/+1asdren-
That is an AWESOME presentation on how frameworks can be benficial. However, its not a very accurate description of Django -- the guy (Sean Kelly) that does the presentation gets a LOT of things wrong about Django, AND it's way out of date.
Still, if your question is "how will a framework help me?," it's a pretty good presentation. It's NOT a good comparison of the different frameworks, though, because he clearly doesn't know what he's talking about (at least where it comes to Django). - dehora, on 10/12/2007, -0/+0"But I'd be interested to know if the benefits of the automatic admin system disappear when you need a CMS with more advanced and possibly unique requirements."
Perhaps. CMSes with "advanced and unique requirements" will tend to need - fine grained permissions, auditing, workflows, versioning, vocab management, wyswig editing multi-channel publication, and so on. Zope/CPS or Zope/Plone would be where I'd start, but these are big systems*, when compared to Django/Rails.
* think J2EE App Server big. - ericmoritz, on 10/12/2007, -0/+1I'd have to say that the automatic admin in an added bonus to an already awesome framework. I think the reason why django has been associated with CMS is because that's what the majority of the Django sites out there do. I'm sure there's nothing stopping you from building an ecommerce site or anything else for that matter in Django. I bet the automatic admin would still work in on an ecommerce app.
- ubernostrum, on 10/12/2007, -0/+0IMHO, Django's admin auth interface is an 80% solution; it covers the most common use cases by providing authentication, permissions and an interface for managing the various types of content on a site.
I don't think there could ever be an "out of the box" system which covered much more than 80%, though, because once you get into that last 20% every project has a different set of conflicting needs. At that point you're going to have to write some of your own admin code, and if there is something off-the-shelf that's tailored to your needs (e.g., a domain-specific CMS app), then use it instead.
That said, we do have projects underway which will add a lot more flexibility to the auth and permissions systems and I believe someone's also working on wiki-style full content history with rollbacks; right now the admin app only logs who edited an object and a summary of what attributes were changed, not a full diff.
- DavidDigg, on 10/12/2007, -0/+1@Kam3k: Django was developed for a newspaper as you can hear about at http://video.google.com/videoplay?docid=-70449010942275062 (from http://www.djangoproject.com/weblog/). Newspapers have really simple business processes (write, edit, publish) and the accountability issues are minimal compared to, say, those of pharma companies. In fact our company makes a hybrid project management/CMS with the features you mention which resembles...well... Hypercard. Anyone remember Hypercard?
- glenn1you0, on 10/12/2007, -1/+1I see it like this:
Drupal is a CMS - if it is does what you want, then have at it. That goes for just about anything.
Perl, python, java, php - all have things they are great at.
TurboGears, Rails, WebWork are frameworks. If you have to build a system that is CMS-like they are all fine. Pick one that suites the language you are comfortable with.
Django is a frame work that gives you a head start on most apps for which you'd use it. If you have to run a race, django lets you start at the half-way point. Everything up to that point is just calisthenics. ( Unless you enjoy writing mindless CRUD forms, then I guess that part is mastubation, right? ). Django is like a virtual CMS waiting for content-types. - simpkins, on 10/12/2007, -0/+0Hi sbrown. I've found the internals of Django quite useful. I'm a researcher working on a text mining application. After reading tons of reviews, docs, and code on the web, I decided to use Django to build a web front-end for a non-CS collaborator. Putting up a quick web app was quick and fun, and I'm looking forward to embellishing it. But I've had to put the web app on hold to concentrate on back-end functionality, and I've found Django's very nice object-relational mapping module tremendously useful. I use it to create scripts that import data files into a database, and database extraction scripts which process thousands of documents and create big (~45000x20000) matrices for input to machine learning algorithms. Thanks to Django, my database code is dead simple (not a line of SQL) and I've been able to concentrate on my research algorithms. Because I'm using Django components, I'll be able to very easily connect all this functionality to the web app. But even if I never get around to hooking it up to the web, Django has been a huge help in my work.
- trutwin, on 10/12/2007, -0/+2My $0.02 on django and why I like it over RoR and others:
1.) django plays nice with Apache in a virtual hosting environment. The developers actually RECOMMEND running with mod_python. I tried (really I did, maybe I'm just a moron) to install RoR in my virtual hosting enviornment on a test site and it was an experiment in pain. Weird unofficial documentation, crazy mod_rewrite cruft, etc. In the end just a bunch of Internal Server Errors. I don't want to run RoR on port 8080, I just want to plug it into my existing system. Even zope is easier. Maybe it's gotten better over the last few months... FYI - There is also an internal dev web server in django if you don't want to integrate with apache.
2.) django uses python - my preference but I just don't care for Ruby for whatever reason.
3.) django doesn't include the kitchen sink. For example, it does not have native AJAX support, but so what, it's so simple to add it in. It does what it advertises and nothing more.
4.) django's built in admin interface is a piece of cake and great when you have an already built custom web app and want to provide a client a quick, easy, but elegant interface to add data to the backend with very little coding effort. django's db introspection tools could be improved, but it does a decent job.
5.) django's documentation is great - no flash demo but easy to follow tutorials and then in-depth references. The dev community is also very helpful and quick to respond.
One thing I don't care for is that you are recommended to pull the latest source from the SVN trunk: http://www.djangoproject.com/documentation/install/ - I'd prefer to have updated tarballs when things are deemed release-worthy.
A great project - the only framework I've tried and actually used. - rj0nes, on 10/12/2007, -0/+0Django is pretty damned cool. Let me develop the http://www.pyweek.org/ site quite rapidly - and I'm usually a Zope developer.
- timc3, on 10/12/2007, -0/+0Having my workplace already commited to python I didn't really see the point in trying to learn Ruby on Rails aswell as Python at the sametime. I tried several python frameworks, but I have always come back to Django as it seems the most flexible, fun and mature of the newbie frameworks for Python out of the lot.
I have also managed to get it to work on Dreamhost with little problem, and the admin interface that is created is excellent for basic use. - kenni, on 10/12/2007, -1/+0Great information. Have a look at http://www.iwebtool.com/tools/ & http://www.iwebtool.com/
- echowarpt, on 10/12/2007, -0/+0errata:
there's an error in the jobs/view.py code:
job_detail won't work unless you change 'object' to 'job':
return render_to_response('jobs/job_detail.html',
{'object': job})
should be:
return render_to_response('jobs/job_detail.html',
{'job': job})
other than that great article - kolakutusu, on 07/14/2008, -0/+0I had this great idea of converting into a digital picture frame.
So, one day I set out to build it, but I stopped because I realised that I don't have a camera.
Or any friends. Or any sort of life in general, really.
Thanks,
http://www.onlineflashgames.org
http://www.bid-directory.net
Digg is coming to a city (and computer) near you! Check out all the details on our