diff --git a/pylons_app/config/middleware.py b/pylons_app/config/middleware.py --- a/pylons_app/config/middleware.py +++ b/pylons_app/config/middleware.py @@ -8,9 +8,9 @@ from pylons import config from pylons.middleware import ErrorHandler, StatusCodeRedirect from pylons.wsgiapp import PylonsApp from routes.middleware import RoutesMiddleware - +from paste.auth.basic import AuthBasicHandler from pylons_app.config.environment import load_environment - +from pylons_app.lib.auth import authfunc def make_app(global_conf, full_stack=True, **app_conf): """Create a Pylons WSGI application and return it @@ -43,7 +43,8 @@ def make_app(global_conf, full_stack=Tru app = RoutesMiddleware(app, config['routes.map']) app = SessionMiddleware(app, config) app = CacheMiddleware(app, config) - + app = AuthBasicHandler(app, config['repos_name'] + ' mercurial repository', authfunc) + if asbool(full_stack): # Handle Python exceptions app = ErrorHandler(app, global_conf, **config['pylons.errorware']) @@ -55,7 +56,7 @@ def make_app(global_conf, full_stack=Tru app = StatusCodeRedirect(app, [400, 401, 403, 500]) else: app = StatusCodeRedirect(app, [400, 401, 403, 500]) - + # Establish the Registry for this application app = RegistryManager(app)