# feed me to mod_wsgi
import os
from beaker.middleware import SessionMiddleware
from paste import httpexceptions
from paste.exceptions.errormiddleware import ErrorMiddleware
from paste.urlparser import make_url_parser
site_dir = os.path.abspath(os.path.dirname(__file__))
app_dir = os.path.join(site_dir, 'apps')
os.environ.update({
'DBURI': 'postgres://XX:XXXX@localhost/XX',
'MAKO_CACHE_DIR': '/tmp/XX_mako',
'MAKO_TEMPLATE_DIR': '%s/mako' % app_dir
})
application = make_url_parser({}, app_dir, 'XX.apps')
application = SessionMiddleware(application, {
'session.cookie_expires': 30000,
'session.type' : 'file',
'session.data_dir' : '/tmp/XX_session',
'session.key' : '_sid'
})
application = httpexceptions.HTTPExceptionHandler(application)
application = ErrorMiddleware(application, debug=True)
Thanks great! Please write more if you can about wsgi, paste, webob and beaker cause there is no examples in www about it at all