blog.py 文件源码

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

项目:M101P-mongodb-course-2016 作者: mahasagar 项目源码 文件源码
def present_welcome():
    # check for a cookie, if present, then extract value

    cookie = bottle.request.get_cookie("session")
    username = sessions.get_username(cookie)  # see if user is logged in
    if username is None:
        print "welcome: can't identify user...redirecting to signup"
        bottle.redirect("/signup")

    return bottle.template("welcome", {'username': username})


# Helper Functions

# extracts the tag from the tags form element. An experienced python
# programmer could do this in  fewer lines, no doubt
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号