bottle.auth_basicããã³ã¬ã¼ã¿ã¨ãã¦ä½¿ãã¨BASICèªè¨¼ããããããã v0.12以ä¸ãå¿ è¦ã # -*- coding: utf-8 -*- import bottle # BASICèªè¨¼ã®ã¦ã¼ã¶åã¨ãã¹ã¯ã¼ã USERNAME = "user" PASSWORD = "pass" def check(username, password): u""" BASICèªè¨¼ã®ã¦ã¼ã¶åã¨ãã¹ã¯ã¼ãããã§ã㯠@bottle.auth_basic(check)ã§é©ç¨ """ return username == USERNAME and password == PASSWORD @bottle.route("/hello") @bottle.auth_basic(check) def hello(): return "hello" if __name__ == '__main__'
{{#tags}}- {{label}}
{{/tags}}