Changeset 1120
- Timestamp:
- 06/04/06 23:00:57
- Files:
-
- trunk/cherrypy/__init__.py (modified) (1 diff)
- trunk/cherrypy/tutorial/tut01_helloworld.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/cherrypy/__init__.py
r1115 r1120 171 171 logfunc(msg, context, severity) 172 172 173 174 def quickstart(root, script_name="", conf=None): 175 """Mount the given app, start the engine and builtin server, then block.""" 176 tree.mount(root, script_name, conf) 177 server.start() 178 engine.start() 179 trunk/cherrypy/tutorial/tut01_helloworld.py
r1110 r1120 22 22 index.exposed = True 23 23 24 # CherryPy always starts with app.root when trying to map request URIs25 # to objects, so we need to mount a request handler object here. A request26 # to '/' will be mapped to HelloWorld().index().27 cherrypy.tree.mount(HelloWorld())28 24 29 25 if __name__ == '__main__': 30 26 import os.path 31 # Start the CherryPy server. 32 cherrypy.config.update(os.path.join(os.path.dirname(__file__), 'tutorial.conf')) 33 cherrypy.server.start() 34 cherrypy.engine.start() 35 27 tutconf = os.path.join(os.path.dirname(__file__), 'tutorial.conf') 28 cherrypy.config.update(tutconf) 29 # CherryPy always starts with app.root when trying to map request URIs 30 # to objects, so we need to mount a request handler root. A request 31 # to '/' will be mapped to HelloWorld().index(). 32 cherrypy.quickstart(HelloWorld()) 33 else: 34 # This branch is for the test suite; you can ignore it. 35 cherrypy.tree.mount(HelloWorld())

