Diving into Django

Yeah, so… Doug said if I was looking to make friends with Python for anything other than systems work, I should probably have a look at Django. Then I found this install on OS X guide the other day, and went ahead and downloaded Django. About 15 minutes later, I was looking at the “It worked!” page. Nice.

One big win for me here is that I can do dev work on Django with just… Django. I don’t have to configure mod_python and apache and mysql and generally play sysadmin on my laptop to get work done. The thing comes with a simple web server meant strictly for development, and it’ll use sqlite as a database for development as well.

That bit about sqlite had me slightly concerned at first, because I thought I was going to have to recode parts of whatever I produced to work with MySQL or PostgreSQL when I was ready to deploy it, but since your data model essentially lives in Django, and not the database, I’m told it’s trivial to move Django to another box, point it at a different database, and tell it to go create the existing data model there.

I just don’t think it gets a whole lot easier than this to get started, and I think for lots of people, myself included, that’s always the hardest part. I don’t know if I’ll like Django enough to use it in production — it’s just too early to tell — but I love the way this has been packaged to make it easy to get going.

  • http://justindriscoll.us Justin

    I’d just add that although Django will serve you all the “kool-aid” you can drink its easy to swap out the components that don’t suit your style. For instance, I love Django (it really goes make web development “stupidly” fast), but I prefer Mako templates over the default as they put the full power of python in your view layer. It easy to miss this when the framework is presented as such an integrated package.

  • http://www.doughellmann.com Doug Hellmann

    Moving from sqlite to postgresql is *mostly* trivial, but I seem to have a particular knack for finding edge cases where the move doesn’t work. Since each db has a different backend implementation under the ORM, sometimes queries aren’t translated in quite the same way. There’s always http://www.postgresqlformac.com/ though, so you can use that for dev if you do run into any issues.