Exemplo n.º 1
0
def index():
    username = request.args.get('username')
    g.username = username
    log_a()
    log_b()
    log_c()

    return render_template('index.html')
Exemplo n.º 2
0
def index():
    print(url_for('my_list'))
    username = request.args.get('username')
    log_a(username)
    log_b(username)
    log_c(username)

    return 'Hello World!'
Exemplo n.º 3
0
def index():
    # session 保存用戶信息
    username = session.get('username')
    g.username = username
    # 在內應用上下文
    # print(current_app.name)
    log_a()
    log_b()
    hello()
    return 'Session Index {}'.format(username)
Exemplo n.º 4
0
def hello_world():
    # print(current_app.name)
    print(url_for('index'))
    # http://127.0.0.1:5000/?username=abc
    username = request.args.get("username")
    # log_a(username)
    # log_b(username)
    # log_c(username)
    g.username = username
    log_a()
    log_b()
    log_c()
    return 'Hello World!'
Exemplo n.º 5
0
def index():
    username = session.get('username')
    # g 对象每次刷新页面 会被重置
    g.username = username
    # print(username)
    # print(current_app.name)

    log_a(username)
    log_b(username)
    # hell0()
    # print(current_app.config['DEBUG'])   # 不是读取current_app的配置文件
    # print(current_app.config['HOST'])     # 读取绑定在app的配置文件
    print(current_app.config['SECRET_KEY'])
    return "首页"