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.

Got a new iPhone

Yeah, I dove into the iPhone after seeing Steve Jobs’s keynote where he talked about all of the new features. When I first saw the iPhone, I had no real interest in it, because I didn’t like the idea that the only apps I could use were those deemed worthy by Apple. I tend to like Apple’s applications, but to pay all that money and have zero say in the matter seemed… wrong.

So far, I have to say that I’m really happy with the iPhone, thanks in large part to the ability to run some non-Apple applications. Those of you who have read my blog for some time will remember my whole crazy time management setup post where I go over how I use Google Calendar and Remember The Milk and stuff. I don’t yet have iCal on the iPhone syncing with my Google Calendar, but I do have Remember the Milk installed and running like a champ. I’ll get around to the calendar stuff soon and let you know if I hit any snags.

The email application works just the way I want it to, which is to say I can get it to alert me to new messages just like my old Blackberry did – with a subtle vibrate+tone. The great new thing about the new iPhone email application is that I can use IMAP with GMail instead of being forced to have a Yahooo! account to take advantage of this feature. Far as I can tell, you can use the IMAP feature with whatever IMAP server you want. I’ve already used three different servers, including GMail.

The phone functionality of the iPhone are, to be honest, nothing to get excited about. The interface features are kinda nice. It’s easy to use speakerphone and add contacts and stuff, but aside from this really cool hack I found (and use), there’s no way to do ‘speed dial’ that I can find. In addition, I think the iPhone is probably the only phone on the market to *not* have voice commands — so you can’t rely on a bluetooth headset for complete hands-free operation of your iPhone while driving. This is *really* bad for me because starting Saturday, New Jersey will start enforcing the ‘no handhelds while driving’ law. No more warnings. If you get caught now, it’s $100 fine.

Yeah – I live in New Jersey. We all have to live somewhere :-/

So… has anyone done any Python coding on/for the iPhone? If it’s running OS X, it should be there, right? Let me know if you’re doing anything cool with it – I’d love to see a writeup in Python Magazine about it.

Python Magazine February Issue Available

Go grab your copy now! If you’re not a subscriber, get the PDF or Print+PDF subscription now!

This month there’s a really cool article about how to take data from a spreadsheet and use it to plot points on Live Maps to provide a useful service to employees in the field. I also chimed in with an article of my own about some of the pitfalls of data modeling, with some suggestions on how to get your data model to help you more than it hurts you (and your customers, and your project…). There’s all kinds of other coolness as well, so check it out, and let us know what you think of it!