E-Scribe News : a programmer’s blog

About Me

PBX My name is Paul Bissex, and e-scribe.com is my consulting business. I build web applications using as much open source software as possible. From September to June I teach web design and other important non-photographic professional skills to photographers. In the '90s I wrote technology commentary and reviews for magazines, newspapers, and web publications, including Wired, Salon.com, FamilyPC, the late lamented Web Review, and the Chicago Tribune. Feel free to email me.

Book Project

I'm co-authoring a book, "Python Web Development with Django", with Jeff Forcier and Wesley Chun. It will be published by Prentice Hall in July 2008, but is available for pre-ordering on Amazon now.

Colophon

This site is built on a fresh trunk checkout of Django, running on Python 2.5.1, served by Apache and mod_python. The database is SQLite. The operating system is FreeBSD, on a VPS hosted at Johncompanies.com. Comment-spam protection by Akismet. Vintage topo imagery from the Maptech archive.

Pile o'Tags

Stuff I Use

Akismet, del.icio.us, Django, dpaste.com, Emacs, FreeBSD, Freenode, jQuery, LaunchBar, MacPorts, Markdown, Mercurial, OS X, Postfix, Python, SQLite, Subversion, TextMate, Trac, Ubuntu Linux, wmii

A Django site.
(Finally!)

Copyright 2008
by Paul Bissex
and E-Scribe New Media

Django as superego

I built a toy site using Django's "generic views" last night. Basically this means that for the first time I created an app without writing any real code -- I defined a model, wrote some rules mapping URLs to Django's generic view functions, and made some templates that get called by that view code (I spent most of my time fussing with the templates!).

This would have been pretty easy to hack up in PHP, too, but there are lots of things that would have been just as easy to not do the "right" way -- things like clean URLs everywhere, redirect-after-POST (to avoid multiple submissions), custom error pages, a polished admin for inspecting and editing the data, nicely modular templates. Django made it easier to do it right than to do it wrong.

The site is a "pastebin" app, so as a bonus it gave me a convenient way to share the source. Insert pro forma apology about quality of code here.

http://paste.e-scribe.com/

Tuesday, May 16th, 2006
+ +
2 comments

Comment from Dagur, later that day

Very handy! Now I just wish gedit and/or pydev did syntax highlighting like that.

Comment from Panos, later that day

Plain and simple. I like it. I couldn't have thought it would be that simple to make a pastebin with django.

Then again, all you gotta do is try, as you showed us :)

Thanks for food for thought.

Post a comment

Comments use Markdown syntax. Your comment will not appear until approved, which may take a few hours or more. Spammers will be torpedoed.


(Will not be shared)

(Optional)