windows中使用django时报错:A server error occurred. Please contact the administrator.

这是因为在视图函数中使用了get函数,获取了不存在的数据 例如:数据库中不存在一条name为hello1的数据,使用如下语句访问 message = Message.objects.get(name='hello1') 就会报错 message = Message.objects.get(name='boddy1') 解决方法: 见下图:    点击上图框中的链接后,自动进入debug.py文件的
相关文章
相关标签/搜索