First look: Creating scientific web applications with Django
Unrelated to the actual body of this post, but possibly of more interest to you, dear reader is that I’ve sent in another job application. This time it is for an Associate Editor position at the esteemed Science magazine. My qualifications are a bit less than what they seemed to be looking for, so I’m not terribly optimistic (what’s new). As usual though I’m nervous… All right, on to the actual post!
I like to think (perhaps a bit ambitiously) that all of my tinkering around has elevated me to the level of “novice” programmer. I can usually decipher things that others have written (ok, I can often do so), and I’ve written several command-line scripts that will do something useful. I think one of the key things I’ve learned is that coding is hard, and I have tons of respect for the people who’ve chosen to do this as their career. Now that I’m starting to get a handle on everything I don’t know, I feel like I’m also starting to find the handholds I need to climb a little farther up the cliff/learning curve.
So far I’ve had the most success writing things in Python. This is most likely because it’s a relatively simple language, designed to be accessible to noobs like me. It’s a fine language which tends to do what I like in ways that (more or less) make sense, and since it’s usage is fairly widespread in bioinformatics I don’t feel like it’s a waste of time to learn.
The problem with most of my “applications” so far is that, like I said above, they are uniformly command-line scripts which either take console or text file input. For my own personal use this is fine - I understand the quirks of the program and am comfortable operating from the console. This tends to be a barrier to more widespread usage, however. Most people (who might use one of the things I’ve coded) aren’t very comfortable at all with entering commands into the terminal or editing a configuration file by hand.
So, I wanted to start looking into ways to start writing things that had a friendlier user interface. I looked into using Glade to make graphical front-ends, but was having trouble wrapping my head around all of the handlers and things. I was also a little worried that this would restrict the final product to a Gnome-based desktop. What I really wanted to do was make something accessible via the web, so that I could install the application on our lab’s central machine and let people use it from their own computers. My problem was that I couldn’t find a decent (i.e. quickly understandable by me) way to build web apps based on Python. That is until I found Django.
Django is a web framework based on Python that just makes it easy to develop a Python-based application and distribute it via the web. I haven’t had time to build anything from the ground up yet (I’ve been working my way through the online tutorial/book), but I can definitely see the potential. I’ve gotten much farther with Django in a much shorter time than with any of the other solutions I’ve looked at so far.
I’ll keep you up to date as I continue my experimentation.

