comparison pylons_app/config/middleware.py @ 101:8b06c420491d

statics moved to pylons.
author Marcin Kuzminski <marcin@python-works.com>
date Sun, 25 Apr 2010 01:25:54 +0200
parents e47d1db5ef20
children 93bd77e1f3c1
comparison
equal deleted inserted replaced
100:d8fc93ae1866 101:8b06c420491d
6 from paste.deploy.converters import asbool 6 from paste.deploy.converters import asbool
7 from pylons.middleware import ErrorHandler, StatusCodeRedirect 7 from pylons.middleware import ErrorHandler, StatusCodeRedirect
8 from pylons.wsgiapp import PylonsApp 8 from pylons.wsgiapp import PylonsApp
9 from routes.middleware import RoutesMiddleware 9 from routes.middleware import RoutesMiddleware
10 from paste.auth.basic import AuthBasicHandler 10 from paste.auth.basic import AuthBasicHandler
11 from pylons_app.lib.simplehg import SimpleHg
11 from pylons_app.config.environment import load_environment 12 from pylons_app.config.environment import load_environment
12 from pylons_app.lib.auth import authfunc 13 from pylons_app.lib.auth import authfunc
13 14
14 def make_app(global_conf, full_stack=True, static_files=True, **app_conf): 15 def make_app(global_conf, full_stack=True, static_files=True, **app_conf):
15 """Create a Pylons WSGI application and return it 16 """Create a Pylons WSGI application and return it
35 36
36 37
37 # The Pylons WSGI app 38 # The Pylons WSGI app
38 app = PylonsApp(config=config) 39 app = PylonsApp(config=config)
39 40
40 # CUSTOM MIDDLEWARE HERE (filtered by error handling middlewares) 41
41
42 # Routing/Session/Cache Middleware 42 # Routing/Session/Cache Middleware
43 app = RoutesMiddleware(app, config['routes.map']) 43 app = RoutesMiddleware(app, config['routes.map'])
44 app = SessionMiddleware(app, config) 44 app = SessionMiddleware(app, config)
45 app = AuthBasicHandler(app, config['repos_name'] + ' mercurial repository', authfunc) 45
46 # CUSTOM MIDDLEWARE HERE (filtered by error handling middlewares)
47 app = SimpleHg(app, config)
48 app = AuthBasicHandler(app, config['repos_name'] + ' mercurial repository', authfunc)
46 49
47 if asbool(full_stack): 50 if asbool(full_stack):
48 # Handle Python exceptions 51 # Handle Python exceptions
49 app = ErrorHandler(app, global_conf, **config['pylons.errorware']) 52 app = ErrorHandler(app, global_conf, **config['pylons.errorware'])
50 53