Forums

Turbogears install

Does anyone have a running Turbogears installation. I'm used to having the ip and port configured in the .ini to run mod_wsgi on apache. I would like an example for _pythonanywhere_com_wsgi.py and my_wsgi_file.py. So far i have the following but receive "Unhandled Exception" on the default page.

_pythonanywhere_com_wsgi.py:

activate_this = '/home/.virtualenvs/projectname/bin/activate'
execfile(activate_this, dict(__file__=activate_this))
import os
import sys
path = '/home/ProjectFiles/'
if path not in sys.path:
    sys.path.append(path)
path = '/home/ProjectFiles2/'
if path not in sys.path:
    sys.path.append(path)
os.environ['PYTHON_EGG_CACHE'] = '/home/ProjectFiles/python-eggs'
from my_wsgi_file import application

and my_wsgi_file.py:

APP_CONFIG = "/home/ProjectFiles/development.ini
#Setup logging
import logging.config
logging.config.fileConfig(APP_CONFIG)

#Load the application
from paste.deploy import loadapp
application = loadapp('config:%s' % APP_CONFIG)

development.ini has:

[server:main]
 use = egg:gearbox#cherrypy
 host = 127.0.0.1
 port = 80

[edited by admin: formatting]

The best place to look when debugging this kind of thing is the error log on your "Web" tab.

At a guess, from the code you posted above, the problem is that your specification of the virtualenv directory is the problem -- /home/.virtualenvs/projectname/bin/activate should probably be something like /home/a1fiberglass/.virtualenvs/projectname/bin/activate (though projectname also looks like something that should be replaced with a real project name, unless your virtualenv really is called projectname).