TurboGears¶
TurboGears is an open source web application framework.
Deploying an Existing TurboGears 2 Project¶
To deploy a TurboGears project that has been developed outside of the WebFaction environment:
- Create a TurboGears application.
- Log in to the WebFaction control panel.
- Click Domains / websites ‣ Applications. The Apps list appears.
- Click the Add new (
) button. The Add
page appears. - In the Name field, enter a name for the application.
- In the App category menu, click to select TurboGears.
- Click the Create button. The View page appears with a confirmation message.
- Make a note of the Port number. This number is required later.
- Remove the provided TurboGears starter project.
- Open an SSH session.
- Switch to the TurboGears application directory. Enter cd ~/webapps/application where application is the name of the application as it appears in the WebFaction control panel and press Enter.
- Remove the starter project. Enter rm -r ./application where application is the name of the application as it appears in the WebFaction control panel and press Enter.
- Upload the TurboGears project to a subdirectory of the application directory. For example if the project is named myproject, upload the project to ~/webapps/application/myproject.
- Update development.ini.
- Open an SSH session.
- Switch to the project directory. Enter cd ~/webapps/application/project where application is the name of the application as it appears in the WebFaction control panel and project is the name of the TurboGears project, and press Enter.
- Open development.ini in a text editor.
- In the [server:main] section, replace the line starting with port = with port = number where number is the port number provided for the application in the WebFaction control panel.
- Save and close the file.
- Update the crontab entry.
- Enter crontab -e and press Enter.
- Edit the line containing
cd /home/username/webapps/application/application;
../bin/paster --serve --daemon development.ini to contain
cd /home/username/webapps/application/project;
../bin/paster --serve --daemon development.ini where:
- username is the account name,
- application is the application name as it appears on the WebFaction control panel,
- and project is the name of the uploaded project.
- Save and close the file.
- Restart TurboGears.
- Stop the TurboGears application. From the project directory, enter cd ..; ./bin/paster serve --stop-daemon and press Enter.
- Restart the TurboGears application. Enter ./bin/paster serve --daemon development.ini and press Enter.
