我正在学习 MongoDB m101p 课程,但遇到了麻烦;
- 开始
mongod
- 启动
python blog.py
监听器 - 使用现有用户登录
- 添加了一个新帖子
- 为该帖子添加了评论
问题是每个定义的网址都有效,不包括根网址localhost:8082/
当我想进入登录页面时,我得到error: 500 internal server error
每次修改代码时,我都会重新启动 python 侦听器。
我无法验证代码,因为根 url 不起作用
有任何想法吗?:
_/ route
# This route is the main page of the blog
@bottle.route('/')
def blog_index():
cookie = bottle.request.get_cookie("session")
username = sessions.get_username(cookie)
# even if there is no logged in user, we can show the blog
l = posts.get_posts(10)
return bottle.template('blog_template', dict(myposts=l, username=username))