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: [email protected] Date: Wed Apr 18 2007 13:00:55 GMT+0200 (CEST) > Hledám jednoduchou monost oveného pístupu na mnou vytváený web. > Pístup me být souasn více. Nael 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() > > /Nenael jsem vak modul userauth. Pome mi nkdo s tímto problémem? > > Pouívám Linux s právy root + Appache + mysql > > Díky > _______________________________________________ > Python mailing list > [email protected] > http://www.py.cz/mailman/listinfo/python > _______________________________________________ Python mailing list [email protected] http://www.py.cz/mailman/listinfo/python
AdmID:64A48D2733E7D8C6D856DBFC192BAF02
_______________________________________________ Python mailing list [email protected] http://www.py.cz/mailman/listinfo/python
