本文整理汇总了Python中login.Login.service方法的典型用法代码示例。如果您正苦于以下问题:Python Login.service方法的具体用法?Python Login.service怎么用?Python Login.service使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类login.Login
的用法示例。
在下文中一共展示了Login.service方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: config_web
# 需要导入模块: from login import Login [as 别名]
# 或者: from login.Login import service [as 别名]
def config_web(cfg={}):
# override Cherrypy's default session behaviour
application_conf = {
'/' : {
'tools.staticdir.root': _curdir,
'tools.staticdir.on' : True,
'tools.staticdir.dir' : ".",
'tools.sessions.on' : True,
'tools.sessions.storage_type' : "file",
'tools.sessions.storage_path' : "/tmp/",
'tools.sessions.timeout' : 60,
'tools.sessions.locking' : 'explicit',
'tools.auth.on': True,
'tools.encode.on' : True,
'tools.encode.encoding': "utf-8"
},
'/favicon.ico' : {
'tools.staticfile.on' : True,
'tools.staticfile.filename' : os.path.join(_curdir,'/image/favicon.ico')
},
'/css' : {
'tools.staticdir.on' : True,
'tools.staticdir.dir' : "css"
},
'/script' : {
'tools.staticdir.on' : True,
'tools.staticdir.dir' : "script"
},
'/image' : {
'tools.staticdir.on' : True,
'tools.staticdir.dir' : "image"
},
}
#No Root controller as we provided all our own.
#cherrypy.tree.mount(root=None, config=config)
root = Login()
root.logout = AuthController().logout
root.xteralink = Interface()
root.system = summary()
root.system.summary = summary()
root.system.dns = dns()
root.system.network_header = network_header()
root.system.network = network()
root.system.wan_detection = wan_detection()
root.system.fqdn = fqdn()
root.system.ip_group = ip_group()
root.system.service_group = service_group()
root.system.diagnostic_tools = diagnostic_tools()
root.system.arp_table = arp_table()
root.system.date_time = date_time()
root.system.ddns = ddns()
root.system.administration = administration()
root.service = dhcp_lan()
root.service.dhcp_lan = dhcp_lan()
root.service.dhcp_dmz = dhcp_dmz()
root.service.virtual_server = virtual_server()
root.service.firewall = firewall()
root.service.connection_limit = connection_limit()
root.service.auto_routing = auto_routing()
root.service.nat = nat()
root.service.snmp = snmp()
root.statistics = stat_bandwidth_utilization()
root.statistics.stat_bandwidth_utilization = stat_bandwidth_utilization()
root.statistics.stat_wan_detection = stat_wan_detection()
root.statistics.stat_dhcp_lan = stat_dhcp_lan()
root.statistics.stat_dhcp_dmz = stat_dhcp_dmz()
root.statistics.stat_fqdn = stat_fqdn()
root.log = view();
root.log.view = view();
root.log.syslog = syslog();
cherrypy.tree.mount(root, "/", config=application_conf)
cherrypy.server.unsubscribe()
server1 = cherrypy._cpserver.Server()
server1.socket_port = 443
server1._socket_host = '0.0.0.0'
server1.ssl_certificate = '/usr/local/conf/server.crt'
server1.ssl_private_key = '/usr/local/conf/server.key'
server1.subscribe()
server2 = cherrypy._cpserver.Server()
server2.socket_port = 80
server2._socket_host = "0.0.0.0"
server2.subscribe()