IDE
After using a few other IDE’s I settled down with Eclipse with Aptana plug-in as the IDE I use for peach³ development. This one environment has support for everything I need while developing a Django application: Python, HTML and JavaScript support is great, with code completion, including completion for the Ext.js javascript library. And I even have the idea that I’m not using the full power of Eclipse yet.
By default, Eclipse and Aptana have no Python support, but it can be integrated with PyDev.
The only thing missing to make it the best environment (in my opinion) is support for Django template tags: a Django template tag inside a HTML or JavaScript file usually results in an inline error message. But you can just ignore these error messages.
For some of the most used Django management commands (runserver and test) I’ve defined ‘tools’ in the Eclipse interface and I can now start my development server or run the testsuite with a single click inside Eclipse.
Here is how I set up the single-click runserver tool:
In “Run > External Tools > External Tools…” I’ve added a new tool called “Django Runserver” and I set up the following on the Main-tab of the tool configuration:
| Location: | ${workspace_loc:/django/bin/django} |
| Working Directory: | ${workspace_loc:/django} |
| Arguments: | runserver localhost:8080 |
I had to setup one more thing: without it, some of the output is lost and output on standard out and standard error won’t be in the correct order: On the Environment-tab of the tool configuration I had to add the environment variable ‘PYTHONUNBUFFERED‘ with value ‘Y’.
That’s it. Now you can click ‘Django runserver’ in the tools menu (see picture below) and the Django development server starts, with it’s output captured inside Eclipse.

I’ve set up a similar tool to run the tests and to update the development environment, for which I use buildout.
zc.buildout
Using tips in this blog posting I have set up a development environment that is seperate from my local python installation using zc.buildout. This has the advantage that I do not have to keep track of the versions of all the python packages and external Django apps I’m using, all this information is stored in the buildout configuration. A simple “bin/buildout” command suffices to setup a working environment for a local development version of peach³, and I’ve set this command up as another tool in Eclipse.
Here is snippet of my current buildout.cfg:
[buildout]
parts =
django
extras
eggs =
werkzeug
pytz
pygments
chardet
docutils
south
python-memcached
mysql-python
[extras]
recipe = iw.recipe.subversion
urls =
http://django-command-extensions.googlecode.com/svn/trunk/ django-command-extensions
[django]
recipe = djangorecipe
version = 1.0.2
settings = development
project = peach3
eggs =
${buildout:eggs}
extra-paths =
${extras:location}/django-command-extensions/
This script contains everything needed to setup the right environment for the Django development server.