New runserver options for in Google App Engine Helper for Django

Update: Just as I was writing/releasing my patch, Matt Brown apparently committed r38 (diff) to the Google App Engine Helper for Django source tree which resolves the same issue -- and much more simply and elegantly than my solution, by using Django's own settings file. Use Matt's solution instead of my patch.

Original post follows:

The Google App Engine Helper for Django is an excellent library if you want to build Django apps on Google App Engine. I've been using it without any hassles on the new Singularity Web Conference site. One thing that it currently lacks, however, is a way to specify dev_appserver options (like smtp_host and smtp_port, for example) when you start the server.

So I got into the lazy habit of using to start the server when I needed to test email functionality and using ./ runserver at other times.

Don't do this! :)

It started tripping me up because the two use different datastore instances. So I would do dumb things like run the server using and then start a shell with ./ shell and wonder why certain entities were not in the datastore. Doh! :)

Instead, I'd recommend that you use for everything.

The problem then remains, how do you pass options to Well, I just bit the bullet and added that functionality to the Google App Engine Helper for Django.

Here's the patch (, 1kb).

After you apply it to your appengine_django folder, you will be able to pass the smtp_host and smtp_port options to the server just like you can with

For example:

./ runserver --smtp_host=localhost --smtp_port=5000

I've only set those two options up because those are what I need at the moment but the code is flexible. Just add more valid options to the valid_args tuple in and they'll automatically be proxied to the dev_appserver instance.