def make_basic(app, global_conf, realm, authfunc, **kw):
 from paste.util.import_string import eval_import
 import types
 authfunc = eval_import(authfunc)
 assert isinstance(authfunc, types.FunctionType), 'authfunc must resolve to a function'
 return AuthBasicHandler(app, realm, authfunc)

def make_basic ( app , global_conf , realm , authfunc , ** kw ) : from paste . util . import_string import eval_import import types authfunc = eval_import ( authfunc ) assert isinstance ( authfunc , types . FunctionType ) , 'authfunc must resolve to a function' return AuthBasicHandler ( app , realm , authfunc )
grant access via basic authentication config looks like this:: [filter:grant] use = egg:paste#auth_basic realm=myrealm authfunc=somepackage .