参考:Integration With Pylons
$ paster create --template=pylons pylons_with_mod_wsgimod_wsgi用環境作成
$ cd pylons_with_mod_wsgi/
$ paster controller hello
$ cat /home/httpd/vhost/pylons/pylons_with_mod_wsgi/pylons_with_mod_wsgi/controllers/hello.py
import logging
from pylons_with_mod_wsgi.lib.base import *
log = logging.getLogger(__name__)
class HelloController(BaseController):
def index(self):
# Return a rendered template
# return render('/some/template.mako')
# or, Return a response
return 'Hello World. - Pylons with mod_wsgi'
$ cp development.ini development_apache.ini
$ diff development.ini development_apache.ini
7c7
< debug = true
---
> debug = false
$ mkdir apache
$ cp pylons_with_mod_wsgi/__init__.py apache/
$ cat apache/pylons.wsgi
import os, sys
sys.path.append('/home/httpd/vhost/pylons/pylons_with_mod_wsgi')
#os.environ['PYTHON_EGG_CACHE'] = '/home/httpd/vhost/pylons/python-eggs'
from paste.deploy import loadapp
application = loadapp('config:/home/httpd/vhost/pylons/pylons_with_mod_wsgi/development_apache.ini')
$ tree apache/ apache/ |-- __init__.py `-- pylons.wsgiApacheのconfファイル
LoadModule wsgi_module modules/mod_wsgi.so
WSGIScriptAlias / "/home/httpd/vhost/pylons/pylons_with_mod_wsgi/apache/pylons.wsgi"
<Directory /home/httpd/vhost/pylons/pylons_with_mod_wsgi/apache>
Order allow,deny
Allow from all
</Directory>