Menu

[r45]: / trunk / tools / myapp.py  Maximize  Restore  History

Download this file

24 lines (20 with data), 831 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import cherrypy
class Root:
@cherrypy.expose
def index(self):
return 'Hi there, Ho there, Hey there'
def setup_server(req):
# Set up site-wide config. Do this first so that,
# if something goes wrong, we get a log.
print "myapp::setup_server: argument is", req
cherrypy.config.update('/var/www/html/test/myapp.conf')
# cherrypy.config.update({'environment': 'production',
# 'log.screen': False,
# 'log.error_file': '/tmp/site.log',
# 'show_tracebacks': False})
cherrypy.engine.SIGHUP = None
cherrypy.engine.SIGTERM = None
cherrypy.tree.mount(Root(), '/test')
# You must start the engine in a non-blocking fashion
# so that mod_python can proceed
cherrypy.engine.start(blocking=False)
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.