routes.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:Log-Mapper 作者: becksteadn 项目源码 文件源码
def index():

    stats = ""

    try:
        stats = shelve.open(path.join(app.root_path, STATS_DB))
    except Exception as e:
        print("ERROR: Could not open STATS_DB")
        print(e)

    attempts = 0
    try:
        attempts = stats['total_attempts']
    except Exception as e:
        print(e)

    ips = 0
    try:
        ips = stats['unique_ips']
    except:
        pass

    countries = 0
    try:
        countries = stats['unique_countries']
    except:
        pass

    try:
        stats.close()
    except:
        pass

    return render_template('index.html', total_logins=attempts, unique_addresses=ips, unique_countries=countries)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号