Ahoj, ja pouzivam toto: http://tools.cherrypy.org/attachment/wiki/PasswordProtectedPages/check.py
Samozrejme je to treba prizpusobit verzi CherryPy (toto je navod pro 2.0), ale to je docela snadne. Radek -------- Original Message -------- Subject: [python] cherrypy + autorizace From: Vladislav Ludík <[EMAIL PROTECTED]> To: python@py.cz Date: Wed Apr 18 2007 13:00:55 GMT+0200 (CEST) > Hledám jednoduchou možnost ověřeného přístupu na mnou vytvářený web. > Přístupů může být současně více. Našel jsem například: > > /import userauth > from userauth import authorize, UserAuth > import cherrypy > import os > > class Root: > @cherrypy.expose > def index(self): > return "This is always accessible by anyone." > > class Members(UserAuth): > """ Unless otherwise stated (secret()), no pages under this > module will be viewable by any member outside of the > members and admins groups. > """ > _db = 'sqlite:' + os.path.abspath('filename.db') > _authorized = ['members', 'admins'] > _unauthorized = '/login' > @cherrypy.expose > def index(self): > return "You're only here if you are a member!" > @authorize(['secret'], '/nowhere') > @cherrypy.expose > def secret(self): > # It would work to just make this another section all-together, but > # it could be useful... > return "Only members of secret can access this..." > cherrypy.root = Root() > cherrypy.root.members = Members() > > /Nenašel jsem však modul userauth. Pomůže mi někdo s tímto problémem? > > Používám Linux s právy root + Appache + mysql > > Díky > _______________________________________________ > Python mailing list > Python@py.cz > http://www.py.cz/mailman/listinfo/python > _______________________________________________ Python mailing list Python@py.cz http://www.py.cz/mailman/listinfo/python