I will assume in this article that you have a working django project in a virtualenv. First you will need to install cherrypy and django-cpserver. You have several way to do this the easier is probably to use pip
pip install cherrypy
pip install -e git://github.com/lincolnloop/django-cpserver.git#egg=django-cpserver
Then you need to edit you settings.py to add "django_cpserver" in the list of your INSTALLED_APPS. This will give you a convenient django management command to start cherrypy server.
./manage.py runcpserver port=8089
Believe it or not this was the hardest part of the recipe from now to the end we will use a nice web interface. In order to launch cherokee-admin on ubuntu I use the following command :
sudo cherokee-admin
We need to define 2 remote sources in the admin interface :
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjiDu-cXiFsaaenAoCux5UamSji5qaTTrXr8xJLwjJWNFSQa82PRGg0KHYwszy05HiKAZJQXyhqYlNIkD1tRSGn1Czml9RfnM4r4yvSxHwRNP088p2zyKWQ6qP0RSQZFLI_cSeib3KQiEM/s320/information_sources.png)
Then we need to define a new target "/django" (alias) that will load and balance the requests to cherrypy instances.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSpRF_Jt7z5VbQVfnm1FHGXCAx-U3TKvdvYJmGvMkkaPKzTSw0ePbLlkCNMSqFfTgRnxVu34kyqXfkQv8Y_v2Tiy57-m6ivg_nTyLOH9TeiqY4Xh1dBkfkSV_niWlc30UZrwYp_4z5Tvo/s320/targets.png)
Then for this target we need to set the handler to "HTTP reverse proxy".
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7p6m3cGlsS_udgNjLQWbdnBPvYJVqXxl8cEwheR-D-3s-hXI8FH_c0iyxLJ6u1-09V4d_2d7Xb6Cpjb0ALreCrU88tT9IfqWZifLqNT6ITRKEzw_tNemltH4RhhL5b5lE86CEgZcKi34/s320/targets.png)
It is time to use the remote sources we have defined earlier.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEic53ROwQMoHswCWEpSC8bSoI6TR0ccaE-mZlNZxdIHjxQSQqqz6AF1sN7D8UbZZXGjQteHiSbk3iuCY1wVJSfXnyA34-YhX-EoKcuo3WKo9l4xWNEx9GRI5GlciGAUHDHAFlPwXDgtcZQ/s320/balancer_and_information_sources.png)
The last bit is to rewrite the url before passing it to the cherrypy instances
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWpBeeX5wrqonrVztlQTuyofWvcwvY-kwIW9cix53gWj2wlZozJwHwvaTpRbVn40TeSlUIOzAm14Hpku-sCq36GcTgMUF5jFZayOq55neoJaI9b9E_zonRZAVeQyBZfS3tBNqkIARznq8/s320/url_rewriting.png)
This is the end of the recipe you can now save the modification and restart the cherokee. I would be glad to read from you the enhancements that could be added to this recipe.