mod_python, user missing

KasiKuula KasiKuula at luuseri.net
Fri Mar 25 13:14:34 EST 2005


apache conf
<Directory /python-publisher/>
     SetHandler mod_python
     PythonHandler mod_python.publisher
</Directory>


and this is in /python-publisher/index.py

__auth_realm__ = 'VIP'

def __auth__(req, user, passwd):
     if user == 'noppa' and passwd == 'potti':
         return True
       else:
         return False

def __access__(req, user):
     if user == 'noppa':
         return True
     else:
         return False

def index(req):
     req.get_basic_auth_pw()
     user = req.user
     return 'user is %s' % (user)


So problem is, how I get user in index function? That gives allways "None"

-- 
  (8)



More information about the Python-list mailing list