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文件的323行,对321行代码修改见下图:
再次运行:

此时报错信息正常,查询的数据不存在
在MAC 和 Linux中不存在这种问题,在 MAC 和 Linux中已经将编码方式默认为 utf8
windows中使用django时报错:A server error occurred. Please contact the administrator.的更多相关文章
- 添加数据时报错:An error occurred while updating the entries. See the inner exception for detail。
场景:前几天在项目开发时,有个bug经常出现,今天花了一整天,终于把它解决了.记录一下解决流程. 解决方法: 主要报错的地方在添加的部分: 1 foreach (var requestProperty ...
- Linux下安装过程中编译PHP时报错:configure: error: libjpeg.(a|so) not found
在Linux下安装PHP过程中,编译时出现configure: error: libjpeg.(a|so) not found 错误的解决的方法: 检查之后发现已经安装libjpeg.可是/usr/l ...
- MyEclipse for Spring启动时报错"An internal error occurred during: 'Updating indexes'.Java heap space"的解决办法
问题 MyEclipse for Spring在启动时,报如下错误:An internal error occurred during: 'Updating indexes'.Java heap sp ...
- c#保存datagridview中的数据时报错 “动态SQL生成失败。找不到关键信息”
ilovejinglei 原文 C#中保存datagridview中的数据时报错"动态SQL生成失败.找不到关键信息" 问题描述 相关代码 using System; us ...
- 安装Django时报错'module' object has no attribute 'lru_cache'
使用pip方法安装Django时报错'module' object has no attribute 'lru_cache' 解决办法如下 命令行输入命令sudo pip install Django ...
- 301ReidrectPages中重复记录导致的500 server error
在Umbraco平台开发一个系统时,遇到一个问题,报错500 server error, system is currently unable to handle this request. 按下F1 ...
- Linux下安装mysql时报错:FATAL ERROR: please install the following Perl modules before executing ./scripts/mysql_install_db:Data::Dumper
如题,安装mysql过程中,执行scripts/mysql_install_db --user=mysql命令时报错: FATAL ERROR: please install the followin ...
- Eclipse启动报错An internal error occurred during: "Initializing Java Tooling"
Eclipse启动报错An internal error occurred during: "Initializing Java Tooling" 解决方案: 删除工作空间work ...
- 解决使用DBeaver连接MySQL时报错-The server time zone value '�й���ʱ��' is unrecognized or represents more than one time zone.
解决使用DBeaver连接MySQL时报错,其实提示很明显. The server time zone value '�й���ʱ��' is unrecognized or represents ...
随机推荐
- 基于SpringBoot+Mybatis+MySQL5.7的轻语音乐网
一个基于SpringBoot+Mybatis+MySQL5.7的轻语音乐网站项目 1.主要用到的技术: 使用maven进行项目构建 使用Springboot+Mybatis搭建整个系统 使用ajax连 ...
- 带你学习Python-基础知识的框架梳理
对于编程初学者来说,在刚刚开始学习Python语言的时候,需要学习的内容有不少,比如计算机原理.网络.Web前端.后端.架构. 数据库都是必须掌握的知识点.因此初学者常常会陷入"只见树木,不 ...
- Python之matplotlib画图
折线图: Matplotlib处理csv文件 这里写两个其他的. 柱状图,柱状图个人喜欢用pygal来画,有两篇文章 - Pygal之掷骰子 和 pygal之掷骰子 - 2颗面数为6的骰子.下面用ma ...
- Python循环列表的方法
python循环列表的几种方法: 第一,依次打印列表中的各项值. 1 #!usr/bin/env python3 2 #!-*- Coding:utf-8 -*- 3 4 ''' 5 多种循环列表的方 ...
- bootstrap(一)栅格系统
中文网:http://www.bootcss.com/ 官网:http://v3.bootcss.com/ 需要准备:离线手册 和 软件包 项目中引用bootstrap.min.js压缩版和boo ...
- 【探索之路】机器人篇(3)-给mwRobot建立模型
在创建一个mwRobot_description程序包那一节中,我们添加了依赖roscpp rospy std_msgs 和 urdf , 现在我们再添加一个xacro依赖. 如何添加依赖? 打开程 ...
- Zookeeper笔记分享
Zookeeper采用zap协议来保证数据的一致性 常见的数据一致性协议采用raft协议 参数解读: tickTime=2000:心跳包发送间隔时长 initLimit=10:leader与fol ...
- JS中的多层次排序算法
引子 排序在编程中随处可见,从开始学习变成,到项目开发,基本上或多或少会遇到一些排序问题,接下来我要写的是我在实际开发终于到的一个排序问题,一开始卡了我很久,后面随着知识积累,实践变多才解决掉了,不知 ...
- Vue3.0聊天室|vue3+vant3仿微信聊天实例|vue3.x仿微信app界面
一.项目简介 基于Vue3.0+Vant3.x+Vuex4.x+Vue-router4+V3Popup等技术开发实现的仿微信手机App聊天实例项目Vue3-Chatroom.实现了发送图文表情消息/g ...
- 如何制作sitemaps网站地图
如何制作sitemaps网站地图 1.0 前言 1.1 xml格式 1.2 常见问题 本文资料来源于网站 1.0 前言 Sitemap 可方便网站管理员通知搜索引擎他们网站上有哪些可供抓取的网页.最简 ...

