I consider myself a web designer. I don’t dabble too deeply into programming. That having been said, I have downloaded, installed, and customized many-a-PHP-script in my day, and I’ve even written a few simple scripts of my own in languages like PHP, Perl, and Javascript. For the most part, I hate programming. It hurts my head (and the keyboard I bash it into, as well). But, I love what a good programmer can do. I want to build cool web applications — but they generally require someone working alongside me, doing all the dirty work while I “make it pretty.”.

Enter Django.

What is Django?

According to the official site, “Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design.”

What that means to me, as a non-programmer, is that Django is a set of core components that takes care of a lot of the programming work that goes into building web applications and other database-driven websites so I don’t have to. Those things that must be done for nearly every web site are built-in, so I can ignore them and focus on what makes each site unique. Here’s an (incomplete) list of things Django provides out-of-the-box:

  • Authentication and authorization (users, groups, and permissions)
  • Database connectivity (several supported databases, no SQL needed)
  • Administrative interface (for adding/deleting/modifying items in the database)
  • URL configuration (for making simple, clean, sexy URLs)
  • Internationalization (makes localization easy)
  • Feed syndication (RSS/Atom)
  • Comments on any type of object (both anonymous comments, which Django calls “free comments” and comments that require registration)
  • “Flat pages” (simple HTML content stored in the database and passed into a template)
  • Now, if you’re used to building sites using a blogging app (Wordpress, TXP, etc.) as a CMS, you’re used to getting all that for free. But you’re also getting a lot of things built-in that maybe you don’t want (unless, of course, you’re building a blog). The limitation I ran across in using a blogging app for my personal site is that I wanted it to be more than just a blog. As soon as I tried to hack a blog into a photo gallery, or a links feed, or a statistics database, a game of Sudoku, or whatever else I could think of, things started to get crufty. I also built a website in which I tried to use a discussion forums app (vBulletin) as a CMS, and that had the same results. It worked — sort of — but it wasn’t extensible, was very hackish, and just generally was inelegant.

    With Django, you get all of these things and none of the limitations of a blogging app.

    How do you build a program with Django?

    Django loosely subscribes to the Model-View-Controller approach to programming. If you’re like me, that means almost nothing to you. According to Wikipedia, “Model-view-controller (MVC) is a software architecture that separates an application’s data model, user interface, and control logic into three distinct components so that modifications to one component can be made with minimal impact to the others.” Sound familiar? It’s quite a similar approach to the one we take in the web standards world with the structure (XHTML), presentation (CSS), and behavior (DOM ... Lire la suite de l'article