|Version 6 (modified by kevin, 9 years ago) (diff)|
Deploying your TG application with an Egg and Easy Install
Q: How can I make a machine in which TG isn't installed, run an app written in TG?
If you quickstarted your application, you should have a setup.py file.
python setup.py bdist_egg
will give you an Egg file that you can copy over to your deployment machine and easy_install. When you do that, your start script is available to start up the TurboGears server. You also need a prodcfg.py that you will call your start script with, as well as an existing database that your project will use (specified in prodcfg.py). This can be the same database as the one you created with
tg-admin sql create
while developing your application.
Note also that as long as the setup.py lists TurboGears as a requirement, it should be possible for somebody to install your application with just the .egg and easy_install - including the installation of TurboGears itself, with all its dependencies.
This is a pretty killer feature for application deployment, especially since it will also upgrade TurboGears if you use an app that needs a later version of something, etc. If your application has other dependencies besides TurboGears, those can get installed too.
Google group discussion here.
(This page can use some edits... I believe you can now pass an egg name to tg-admin sql, so you should be able to run tg-admin sql create on your production box as well at this point.)