lribeiro.cherrypy.authorizer和neomodel的基本用户模型、身份验证者和授权者

lribeiro.cherrypy.authorizer.neomodel的Python项目详细描述


lribeiro.cherrypy.authorizer和neomodel的基本用户模型、身份验证程序和授权程序

用法:

importcherrypyfromlribeiro.cherrypy.authorizerimportauthorizefromlribeiro.cherrypy.authorizer.authenticationimportAuthControllerDefaultDispatcherfromlribeiro.cherrypy.authorizer.neomodel.authimportauthenticator,authorizerclassRoot:@cherrypy.exposedefindex(self):return'index'@cherrypy.expose@authorizedefauth_required(self):return'auth required'@cherrypy.expose@authorize({'read':'page','write':'log'})defauthorized(self):return'authorized'@cherrypy.expose@authorize({'edit':['page','site']})defunauthorized(self):return'unauthorized'config={'/':{'tools.sessions.on':True,'tools.authorizer.on':True,'auth.authenticator':authenticator,'auth.authorizer':authorizer,'auth.login_page':'/login'}}if__name__=='__main__':root=Root()root.auth=AuthControllerDefaultDispatcher()cherrypy.quickstart(root,'/',config)

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java如何在导入到Google工作表时使用ApachePOI显示系列标签   java在Swing表上修改数据生成SQL   java TCP数据包在网络级别合并   java自动连线bean在线程位置为空   javasocket。禁用无线连接时getOutputStream()阻塞   JSON上的javascript字符串数组。stringify输出unicode字符   java在Oracle数据库中存储不同类型数据的最佳体验   Spring MVC中模板引擎后的java进程输出   不知从哪里来的java空字符串。   如何加载java。使用Adobe Flex的客户端的属性文件?   java如何替换多层括号之间的所有内容?   {JSONObject必须以java'开头   java使用commandButton或commandLink返回并管理HTML控件值   java Android大文本视图动态   java JMock需要自定义类   java Android应用程序在emulator中工作,但在设备中失败   java连接到derby数据库时使用什么文件路径格式?   java在一个函数调用中返回两个结果?