Skip to content

Instantly share code, notes, and snippets.

@srhopkins
Last active December 19, 2015 07:49
Show Gist options
  • Save srhopkins/5921215 to your computer and use it in GitHub Desktop.
Save srhopkins/5921215 to your computer and use it in GitHub Desktop.
cherrypy.tools.session_auth.check_username_and_password
# Roll your own check_user, pretty_login, logout, and Root functions accordingly.
_cp_config={'/':{'tools.sessions.on':True,
'tools.sessions.storage_type':'file',
'tools.sessions.storage_path':'./',
'tools.sessions.timeout':60,
'tools.session_auth.on':True,
'tools.session_auth.login_screen':pretty_login,
'tools.session_auth.check_username_and_password':check_user,
}
}
cherrypy.config.update({'server.socket_host':'0.0.0.0',
'server.socket_port':80})
cherrypy.quickstart(Root(),'/',config=_cp_config)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment