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.
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.
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.
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
Copyright 2008
by Paul Bissex
and E-Scribe New Media
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.e. I couldn't tell you how to make it work on Windows), SQLite and a working install of Django trunk. It is fully "Works on My Machine" certified.
When you type python jngo.py, it runs the syncdb command to create a database in the working directory, then prompts you to create a superuser, then populates the database with some dummy content, then launches the built-in development server. When you go to the provided URL you'll see something like this:
(Actually, you'll only see the "Edit this page" link if you log in, either to the admin site at /admin/ or into the login-protected "Top Secret" page.)
Features include:
All in a single file of under 60 lines of actual Python code (Though the lines containing the templates are a bit long).
The source is on dpaste.com if you're curious. You know you are.
Scary as it is, I think it's also a neat demo of all the stuff Django gives you for free. jngo.py uses, among other features, the syndication feed framework, the Flatpages application, the elusive comments framework, the user authentication features, and of course the glorious admin application .
I couldn't resist making a version that works with Django 0.96. It is slightly fewer lines because the call to createsuperuser() is not needed.
http://dpaste.com/hold/31953/
Even for someone with as small an understanding of Django's innards as me - it's surprisingly readable. Apart from the templates!
I couldn't tell you how to make it work on Windows
It works just fine without alteration on Windows.
Thanks! I should have had more faith. I updated the post accordingly.
Hey, this looks pretty cool :) We're developing an app at the moment that would work well as a self-contained application and this might come in handy :)
It is really nice to see that Django can be used like Ruby on Rails Camping and web.py.
It works on windows and mysql to have a look at http://dpaste.com/33699/
Comments use Markdown syntax. Your comment will not appear until approved, which may take a few hours or more. Spammers will be torpedoed.
The iPhone keyboard doesn't suck
Python one-liner of the day
7 comments
How not to advocate via Google Code
2 comments
99 problems
3 comments
bitmonk
Obscure "svn mv" problem solved
88 days ago
Charlie
Book news: Rough Cuts and Amazon
89 days ago
Simon Griffee
Django Mercurial mirror tweaks
106 days ago
Jason Calleiro
From PHP to Python
107 days ago
Yuli
dpaste.com
110 days ago
bruce
Neat Python hack: infix operators
114 days ago
David Reynolds
The original Lego Star Wars
122 days ago
At least 36614 pieces of comment spam killed since January 12th. Thanks are mostly due to Akismet.
Nicely done. Crazy how quick you can get something running with Django and python at hand.