title: TypeError: 'str' object is not callable when using CherryPy 3.2 Basic Authentication
body: <p>My site configures CherryPy by way of a configuration file.  In the configuration file I am trying to setup basic authentication.  I have specified the fully qualified path to a "checkpassword" function.  But I'm getting an error about the tools.auth_basic.checkpassword line.  </p>
  
  <p><a href="http://docs.cherrypy.org/dev/refman/lib/auth_basic.html" rel="nofollow">Most of the samples online</a>, do not use a config file. So it's making things more difficult.   </p>
  
  <p>My config file:</p>
  
  <pre><code>[/]
  tools.auth_basic.on = True
  tools.auth_basic.realm = "some site"
  tools.auth_basic.checkpassword = "Infrastructure.App.Authentication.FindPassword"
  </code></pre>
  
  <p>My startweb.py file:</p>
  
  <pre><code>import ...
  ...
  
  cherrypy.tree.mount(DesktopRootController(), "/", "auth.conf")
  
  cherrypy.engine.start()
  cherrypy.engine.block()
  </code></pre>
  
  <p>The error message:</p>
  
  <pre><code>[10/Sep/2011:12:51:29] HTTP Traceback (most recent call last):
   File "lib.zip\cherrypy\_cprequest.py", line 642, in respond
     self.hooks.run('before_handler')
   File "lib.zip\cherrypy\_cprequest.py", line 97, in run
     hook()
   File "lib.zip\cherrypy\_cprequest.py", line 57, in __call__
     return self.callback(**self.kwargs)
   File "lib.zip\cherrypy\lib\auth_basic.py", line 76, in basic_auth
     if checkpassword(realm, username, password):
  TypeError: 'str' object is not callable
  </code></pre>
  
  <p>My "callable" is defined here:</p>
  
  <pre><code>import cherrypy
  
  class Authentication:
      def FindPassword(realm, username, password):
          print realm
          print username
          print password
          return "password"
  </code></pre>
  
  <p>And this is some of the "App" class:</p>
  
  <pre><code>from Authentication import Authentication
  
  class App:
      def __call__(self):
          return self
  
      def __init__(self):
          self._authentication = Authentication
  
      @property
      def Authentication(self):
          return _authentication
  </code></pre>