|
Revision 943
(checked in by rdelon, 3 years ago)
|
Deprecated "initOnly" and "serverClass". New names are "init_only" and "server_class"
|
- Property svn:eol-style set to
native
|
| Line | |
|---|
| 1 |
"""Test WSGI servers and gateways, such as mod_python. |
|---|
| 2 |
|
|---|
| 3 |
mod_python |
|---|
| 4 |
---------- |
|---|
| 5 |
|
|---|
| 6 |
Put the following four lines somewhere in your Apache2 .conf: |
|---|
| 7 |
|
|---|
| 8 |
PythonImport cherrypy.test.test_noserver REDROVER.HQAMOR.amorhq.net |
|---|
| 9 |
SetHandler python-program |
|---|
| 10 |
PythonHandler wsgiref.modpython_gateway::handler |
|---|
| 11 |
PythonOption application cherrypy._cpwsgi::wsgiApp |
|---|
| 12 |
|
|---|
| 13 |
""" |
|---|
| 14 |
import test |
|---|
| 15 |
test.prefer_parent_path() |
|---|
| 16 |
|
|---|
| 17 |
import cherrypy |
|---|
| 18 |
from cherrypy import _cpwsgi |
|---|
| 19 |
|
|---|
| 20 |
class HelloWorld: |
|---|
| 21 |
def index(self): |
|---|
| 22 |
return "Hello world!" |
|---|
| 23 |
index.exposed = True |
|---|
| 24 |
wsgi_asp = index |
|---|
| 25 |
|
|---|
| 26 |
cherrypy.root = HelloWorld() |
|---|
| 27 |
cherrypy.root.test = HelloWorld() |
|---|
| 28 |
|
|---|
| 29 |
cherrypy.config.update({"server.environment": "production"}) |
|---|
| 30 |
cherrypy.server.start(server_class = None) |
|---|
| 31 |
|
|---|