WEB_DEVELOPMENT

Django LogEntry to the rescue

If you use Django’s admin application, you’re familiar with its “Recent Actions” sidebar. It gives a simple summary of your latest edits, including clickable links to the relevant objects (not any ones you deleted, naturally, but ones you added or changed). It’s probably not something you look at very often, unless you do such intensive work in the admin that you lose track of things. Django stores that log data (via the admin’s LogEntry model) for all admin users, a fact which has caused me to repeatedly daydream about writing a custom view or two to display it.

Making your way from PHP to Python and Django

“I’m a PHP programmer and I want to check out this Django thing. What should I do?” I’ve been seeing this kind of question pop up more and more, and I have a few answers. First-hand experience as well as many conversations with developers online have led me to the same conclusion: the curious person behind such a question should be encouraged and assisted. (I’ll call that person “Pat” for the rest of the post, for convenience and conscientious gender-neutrality.

How not to advocate via Google Code

People sure are excited about the Google App Engine. Especially people who have some other favorite language besides Python. A significant number of the issue tracker items are of the form “Please add support for $MY_LANGUAGE”, where $MY_LANGUAGE might be VB.NET, C#, PHP, Java, Groovy, Ruby, Perl, etc. ad nauseam. I’m not going to comment on the language-wars aspect. But if you want your language supported (this goes for any issue in the tracker in fact), the thing to do is not to go to one of those issue pages and add a comment that consists of “+1”.

From PHP to Python

A former colleague from my days in print design (and a wonderfully loyal reader of my blog to boot) writes to ask whether he should learn Python. He’s a smart guy with a deep background in typography, publishing, and the Mac. He is not a programmer by trade, but has taught himself enough PHP to build a custom CMS for his newspaper. He writes: I’ve invested so much time in PHP, and am quite proficient now (not bad for it being more of an avocation), but I respect your opinion and for a long time have wondered about switching.
World's ugliest Django app

World's ugliest Django app

OK, this is an ugly hack. But also (possibly) cool if you’re into ugly hacks. I’ve written a small Python script that is a fully functional, self-contained, self-starting Django application. You don’t need to put it on your PYTHONPATH or set DJANGO_SETTINGS_MODULE. You don’t need a web server. It even creates some dummy content for you. I call it jngo.py – it’s somewhat compressed. The only prerequisites are a Unix-like operating system (i.

darcs on pair.com

Shared hosting is starting to feel pretty quaint in the face of cheap and easy virtualization, but I still have some clients who use it. While doing some maintenance work today on one client’s Pair.com account, I started to twitch when I realized I was about to make some changes without using version control. I checked for Bazaar, Mercurial, and darcs command-line binaries; only darcs was installed, luckily a fairly recent version (1.

Django Unicodification

On July 4th, which in America is a holiday involving even less attention paid to international events than usual, a wonderful thing happened to Django. On that day the Unicode branch, whose goal was to make it easier to work with non-ASCII character data in Django, was merged into the main development version (or “trunk” in svn-speak). There’s an application porting guide on the Django wiki. The main reason I’m making this post, though, is because while Malcolm Tredinnick’s blog doesn’t allow comments (nudge) I wanted to make sure he was publicly thanked for all his hard work on this project.