“The Web Framework for Perfectionists with Deadlines.”
Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design.
Initially developed at a local newspaper in Kansas, it has since found favour for developing all kinds of sites and applications, from content-heavy sites such as www.lawrence.com to Web 2.0 applications such as www.tabblo.com.
Django is quite popular for its extensive documentation.
At work lately we've been writing a bunch of tests for all of the work we've been doing. This is generally a good thing (tm). I was getting tired of manually having to write all of the code to test the views inside of my app. So I decide to write a little app that helps me automate the writing of tests.
I wrote a piece of middleware (that should obviously only be used during development!) that shadows the current activity in django into a log file. This log file should then be ready to copy and paste into a doctest for easy testing of your views. This is a little hard to explain, but the code should be pretty self explanitory.
I created a google code project for it so that people can go ahead and hack on it and make it better. It is pretty rudimentary at current, but it gets the job done.
I think a big win from this approach is that your testing data is much more "real", since it's a copy of your session with a real browser. I know writing django tests I sometimes use contrived data because it is a pain to enter it all. This should help improve on that situation.
Here is a video of it in action, this should allow it to make more sense.
Django TestMaker from Eric Holscher on Vimeo.
At work lately we've been writing a bunch of tests for all of the work we've been doing. This is generally a good thing (tm). I was getting tired of manually having to write all of the code to test the views inside of my app. So I decide to write a little app that helps me automate the writing of tests.
I wrote a piece of middleware (that should obviously only be used during development!) that shadows the current activity in django into a log file. This log file should then be ready to copy and paste into a doctest for easy testing of your views. This is a little hard to explain, but the code should be pretty self explanitory.
I created a google code project for it so that people can go ahead and hack on it and make it better. It is pretty rudimentary at current, but it gets the job done.
I think a big win from this approach is that your testing data is much more "real", since it's a copy of your session with a real browser. I know writing django tests I sometimes use contrived data because it is a pain to enter it all. This should help improve on that situation.
Here is a video of it in action, this should allow it to make more sense.
Django TestMaker from Eric Holscher on Vimeo.
Heard from Robert Lofthouse on Twitter. The Djangocon 2008 conference will be held at Google Campus (Googleplex) in Mountain View!! September 6 and 7th. That's only two months away, so hopefully this gets pulled together well.
The Official Post announcing DjangoCon. The DjangoCon website should be up on friday.
I was just convinced to setup mod_wsgi on my server instead of mod_python, and I'm going to write up how I did it. All of the documentation I found on the internet was really hard to follow, so I'm going to distill it here the best that I can.
This is assuming Ubuntu 8.04 Server Edition.
Step 1:
apt-get install libapache2-mod-wsgi
This should automatically install mod_wsgi into your apache instance and install it.
Step 2:
Create an apache directory on your filesystem, presumably inside of your Django project. I keep my code in ~/Python/Project, so I did:
mkdir ~/Python/PROJECT/apache
vim ~/Python/PROJECT/apache/django.wsgi
Then in that file you need to copy this code:
import os, sys
sys.path.append('/home/eric/Python/PROJECT')
os.environ['DJANGO_SETTINGS_MODULE'] = 'PROJECT.settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
This creates an interface between Django and WSGI, as far as I can tell. If you start getting errors about not seeing your project or modules, try adjusting and/or adding some things to your sys.path.
Step 3:
Inside your /etc/apache2/ directoy, you will find the directory sites-available/. This is where you are going to put your configuration for your server. Presumably it will have a file called default in it that you will edit. So:
In /etc/apache2/sites-available/default:
ServerAdmin eric@ericholscher.com
ServerName ericholscher.com
ServerAlias www.ericholscher.com
DocumentRoot /var/www/
LogLevel warn
WSGIDaemonProcess ericholscher processes=2 maximum-requests=500 threads=1
WSGIProcessGroup ericholscher
WSGIScriptAlias / /home/eric/Python/PROJECT/apache/django.wsgi
Alias /media /var/www/media/
The last 3 lines of WSGI stuff if what you want to pay attention to. You are pointing WSGIScriptAlias to the file we created in Step 2. The other two WSGI prompts aren't necessary unless you are running multiple sites on your server. The Alias is so that the /media URLs on your site continue to work, it should point to where ever you have your media files stored.
Hopefully this will get you started along the way to setting up mod_wsgi on Apache with Django. If not, feel free to leave comments or email me
EDIT:
Someone in the comments pointed out this website on the mod_wsgi wiki is also helpful: Integration with Django
There appears to be a page on the Django WIki as well if you need more pointers.

It is being kinda announced about DjangoCon 2008! It is going to be in the Bay Area and sometime around the release of Django 1.0 in September. I heard about it a couple days ago from Jacob at the office (because I work at Mediaphormedia, birthplace of Django). I'm really excited about it, and I'm thinking about heading out for it. I have never been to the Bay Area. We'll see how it pans out when it gets announced, but I'm almost definitely going!
YAY!!
Update: An official announcement should be made Monday or Tuesday, including dates and location.
Check my post here for updates: DjangoCon: September 6-7, GooglePlex
Will Larson just created a post titled Replacing Django’s ORM with SQLAlchemy that covers using SQLAlchemy with a Django project. It’s a great write-up, and generally what Django folks are referring to when they say, “of course you can use SQLAlchemy with Django.” I think Will does a good job of stepping you through the important bits.