Django gymnastics

Recently I’ve been noodling with Django, a Python-based web application framework that’s comparable in many ways to Ruby on Rails. It appeals to me for a variety of reasons. Python has been my language of choice for several years, and going forward I expect it to help me build bridges between the worlds of LAMP and .NET. Django’s templating and object-relational mapping features are, as in RoR, hugely productive. And Django’s through-the-web administration reminds me of a comparable feature in Zope that I’ve always treasured. It’s incredibly handy to be able to delegate basic CRUD operations to trusted associates, who can use the built-in interface in lieue of the friendlier one you’d want to create for the general public.

The recommended way to deploy Django is to run it under mod_python, the Apache module that keeps Python interpreters in memory for high performance. But a lot of popular web hosting services don’t support that arrangement. For example, I just signed up for an account at BlueHost, the service used by the instructional technologists at the University of Mary Washington, and I looked into what it would take to get Django working in that environment.

Despite helpful clues it still took a while to work out the solution. In the process I reactivated dormant neurons in the parts of my brain dedicated to such esoterica as mod_rewrite and FastCGI, but I’d rather have been working with Django than working out how to configure it.

By way of contrast, setting up WordPress — a more well-known and popular application — was a one-click operation thanks to Fantastico, an add-on installer for the cPanel site manager.

I’ve heard it said that a compelling screencast is one key factor influencing the adoption of a new web-based application. One-click install in shared hosting environments has to be another. For a while, anyway, until the virtualization juggernaut gives everyone the illusion of dedicated hosting.

11 Comments

  1. Jon, I’ve been learning Django myself lately, as an ex-Zopista. What a wonderful, Pythonic framework!

    Agreed that it needs a much easier installation procedure; I guess I’m used to fiddling with Apache config files after all the indignities of running Subversion, Trac, etc.

    Would love to hear more about your experiences with Django.

  2. … if you think Django is tough, try setting up RoR on a web host… capistrano, SVN, Mongrel, mod_proxy_balancer, mod_fcgi, apache2.x/2.2 …

    I must say, however, the framework is great.

  3. Yup, perhaps the biggest reason for PHP’s success is that it Just Works™ on most web hosts. There are a few Django-savvy hosts out there, but by and large it can take a bit of doing to get things set up.

    If you’re still having problems, I strongly recommend you ask for a hand in the IRC channel (#django on freenode) or on the django-users mailing list (http://groups.google.com/group/django-users/). We’ve got a fantastic community you can take advantage of :)

    I’ve been a fan of yours for years, so it’s immensely flattering to see you check out Django. I hope you keep enjoying it, and I’d be very interested to read your thoughts after you’ve had a chance to work with it for a while.

  4. +1 for Django IRC. I’ve been working with it for a while, though I’m not terribly fluent w/ FCGI. I, too, would be happy to help.

  5. I know there’s at least one hosting provider — WebFaction — who’ve gone to the trouble of making Django setup easy through their control panel. Others… it’s a mixed bag. Those who have good support for Rails typically have good support for Django, usually through FastCGI, so that’s a bit of a help, and there’s a page on the Django wiki (http://code.djangoproject.com/wiki/DjangoFriendlyWebHosts) with a list of hosts and relevant notes for setup.

    If you run into any issues, I’ll throw in another offer of help if you need it :)

  6. I’m a great Django fan and the only problem I experiment these days is the scarcity of web hosting companies officially supporting this framework (in fact the issue regards Rails also).
    You’re right: WebFaction is a safe bet for Django developers. Its basic shared plan (Shared 1) at just $7.50/month could be very competitive with current Dreamhost customers, such as me, but this plan can’t run Django or Rails sites: you have to subscribe to more expensive services. In my opinion WebFaction should offer Django/Rails support with its cheaper plan (with a 20-25MB cap on RAM used by long-running processes). This move will attract a lot of Dreamhost/BlueHost/etc. users and will ignite the market. Users will begin to experiment with Shared 1 and when/if their site really takes off they will migrate to more expensive plans.

  7. Alberto:

    > but this plan can’t run Django or Rails sites

    Well, something tells me this is about to change … make sure you watch our blog very closely this afternoon ;)

    Remi.

  8. WoW! My contract with DH will expire in february. JustInTime!

    In my opinion an affordable shared service, the 1.0 release and the publication of the DjangoBook will represent the real tipping point for Django.

    2007 will be The Year of the Python :)

  9. Hi there,

    I must confirm that 2007 is year of the python (at least for me) :) In december 2006 started using django, bought vps at openhosting and two days ago released portablepython.com :)

    Go python go!

    P.S. portablepython.com = python + django on USB stick

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s