Changeset 1867
- Timestamp:
- 01/17/08 00:24:53
- Files:
-
- trunk/cherrypy/_cpwsgi.py (modified) (1 diff)
- trunk/cherrypy/test/helper.py (modified) (1 diff)
- trunk/cherrypy/wsgiserver/__init__.py (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/cherrypy/_cpwsgi.py
r1786 r1867 364 364 365 365 s = wsgiserver.CherryPyWSGIServer 366 # We could just pass cherrypy.tree, but by passing tree.apps, 367 # we get correct SCRIPT_NAMEs as early as possible. 368 s.__init__(self, bind_addr, _cherrypy.tree.apps, 366 s.__init__(self, bind_addr, _cherrypy.tree, 369 367 server.thread_pool, 370 368 server.socket_host, trunk/cherrypy/test/helper.py
r1837 r1867 124 124 125 125 def sync_apps(profile=False, validate=False, conquer=False): 126 apps = [] 127 for base, app in cherrypy.tree.apps.iteritems(): 128 if base == "/": 129 base = "" 130 if profile: 131 app = profiler.make_app(app, aggregate=False) 132 if conquer: 133 try: 134 import wsgiconq 135 except ImportError: 136 warnings.warn("Error importing wsgiconq. pyconquer will not run.") 137 else: 138 app = wsgiconq.WSGILogger(app) 139 if validate: 140 try: 141 from wsgiref import validate 142 except ImportError: 143 warnings.warn("Error importing wsgiref. The validator will not run.") 144 else: 145 app = validate.validator(app) 146 apps.append((base, app)) 147 apps.sort() 148 apps.reverse() 149 cherrypy.server.httpserver.wsgi_app.apps = apps 126 app = cherrypy.tree 127 if profile: 128 app = profiler.make_app(app, aggregate=False) 129 if conquer: 130 try: 131 import wsgiconq 132 except ImportError: 133 warnings.warn("Error importing wsgiconq. pyconquer will not run.") 134 else: 135 app = wsgiconq.WSGILogger(app) 136 if validate: 137 try: 138 from wsgiref import validate 139 except ImportError: 140 warnings.warn("Error importing wsgiref. The validator will not run.") 141 else: 142 app = validate.validator(app) 143 cherrypy.server.httpserver.wsgi_app = app 150 144 151 145 def _run_test_suite_thread(moduleNames, conf): trunk/cherrypy/wsgiserver/__init__.py
r1850 r1867 17 17 18 18 The CherryPy WSGI server can serve as many WSGI applications 19 as you want in one instance :20 21 wsgi_apps = [('/', my_crazy_app), ('/blog', my_blog_app)]22 server = wsgiserver.CherryPyWSGIServer(('0.0.0.0', 80), wsgi_apps)19 as you want in one instance by using a WSGIPathInfoDispatcher: 20 21 d = WSGIPathInfoDispatcher({'/': my_crazy_app, '/blog': my_blog_app}) 22 server = wsgiserver.CherryPyWSGIServer(('0.0.0.0', 80), d) 23 23 24 24 Want SSL support? Just set these attributes: … … 36 36 WSGI server, which is independant from the rest of CherryPy. Don't 37 37 let the name "CherryPyWSGIServer" throw you; the name merely reflects 38 its origin, not it 's coupling.38 its origin, not its coupling. 39 39 """ 40 40 … … 57 57 from urllib import unquote 58 58 from urlparse import urlparse 59 import warnings 59 60 60 61 try: … … 1015 1016 # so that the server can call different wsgi_apps, and also 1016 1017 # correctly set SCRIPT_NAME. 1018 warnings.warn("The ability to pass multiple apps is deprecated " 1019 "and will be removed in 3.2. You should explicitly " 1020 "include a WSGIPathInfoDispatcher instead.", 1021 DeprecationWarning) 1017 1022 self.wsgi_app = WSGIPathInfoDispatcher(wsgi_app) 1018 1023

