Alternate Deployment Patterns

This document attempts to discuss alternate patterns for deploying TurboGears 2.1. It is written with the assumption that you have at least read the Standard Deployment Pattern, as most documents will simply discuss the differences from a standard deployment.


New developers should likely use the Standard Deployment Pattern (if possible). The choices involved in alternate installations can be daunting if you aren’t yet familiar with the various components.

Web-Server Choice

The web-server, which actually receives and processes HTTP requests from clients and converts them to WSGI requests for your TurboGears project, can significantly impact the performance and scalability of your site.

  • Apache Mod-WSGI – the standard way to deploy on Apache
  • Running TurboGears 2.1 behind Apache with Mod Proxy – runs Apache as a front-end with a Paste web-server running on a local port. Allows you to run the Paste server as any user
  • FastCGI/WSGI – Running TurboGears 2.1 behind Apache – runs Apache as a front-end with a FastCGI process using Mod-Rewrite to make the CGI appear at the correct point in the server’s URL-space.
  • paster serve production.ini – while not recommended for large or high-traffic sites, Paste’s web-server can often serve for small internal sites with few users. See Deploying as a Service/Daemon for a discussion of how to keep your server running.
  • NGINX Web Server – an alternative asynchronous high-performance web-server which can reverse-proxy TurboGears
  • Light HTTPD – has built-in FastCGI support, so can be used to reverse-proxy TurboGears
  • Twisted Web2 – likely only of interest if you are already using Twisted for your application and simply want to host a TurboGears application within it. Twisted’s WSGI implementation is not heavily optimized, so should not be used for high-performance sites.
  • MS-IIS users may want to experiment with the WSGI support from the ISAPI-WSGI project.


document use of isapi-wsgi with TurboGears


Difficulty: Hard. Document use of IIS with TurboGears thru a proxy.

Database Choice

If you are using SQLAlchemy (the default ORM for TurboGears 2.1), then by-and-large your choice of database back-end is a matter of preference.

  • PostgreSQL – is a robust, mature, well documented free database server which meets or exceeds most new user’s needs.
  • MySQL – allows you to trade robustness (ACID compliance, for instance) for raw speed and some exotic features that are add-ons for PostgreSQL
  • Oracle – if your site is an Oracle shop with specialized Oracle admins it may be appropriate to use an Oracle DB for your TurboGears application
  • SQLite – can be used for extremely small sites (e.g. a local web-server intended solely to be used by a single user). It is extremely easy to set up and comes with later versions of Python.
  • MSSQL – if you are already using MSSQL for your site, and have admins who maintain the servers, it may be appropriate to use MSSQL for your TurboGears application.


Add section on “repeatable deployment options”