AttributeError at /home/home/ Exception Type: AttributeError at /home/home/
"错误提示信息":
Environment:
Request Method: GET Request URL: http://localhost:8000/home/home/
Django Version: 1.7.5 Python Version: 2.7.0 Installed Applications: ('django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'home') Installed Middleware: ('django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.auth.middleware.SessionAuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware')
Traceback:
File "D:\Python27\lib\site-packages\django-1.7.5-py2.7.egg\django\core\handlers\base.py" in get_response
111. response = wrapped_callback(request, *callback_args, **callback_kwargs) File "D:\Pythonweb\testweb\laji\home\views.py" in home
5. return render("templates/home.html", {}) File "D:\Python27\lib\site-packages\django-1.7.5-py2.7.egg\django\shortcuts.py" in render
46. context_instance = RequestContext(request, current_app=current_app) File "D:\Python27\lib\site-packages\django-1.7.5-py2.7.egg\django\template\context.py" in __init__
209. updates.update(processor(request)) File "D:\Python27\lib\site-packages\django-1.7.5-py2.7.egg\django\core\context_processors.py" in debug
40. if settings.DEBUG and request.META.get('REMOTE_ADDR') in settings.INTERNAL_IPS:
Exception Type: AttributeError at /home/home/
Exception Value: 'str' object has no attribute 'META'
《------------------------------错误原因-------------------------》
views.py 中的返回值不正确
def home(request):
return render("templates/home.html", {})
换成
def home(request):
#return render("templates/home.html", {})
return render_to_response("home.html", {'song': 'Take me to your heart!'})
AttributeError at /home/home/ Exception Type: AttributeError at /home/home/的更多相关文章
- (学)解决诡异的 Exception type: SocketException 127.0.0.1:80
许久不发博了,老杨听完故事让我持续写一下“十万个为什么” 一.背景: 昨天我们亲密的战友HH刘老板亲临现场,指出我们协用的一个项目,客户方面反馈手持终端系统不定期“卡死”,要我们安排人飞到广州驻场解 ...
- Exception Type & Exception Code
1.Exception Type 1)EXC_BAD_ACCESS 此类型的Excpetion是我们最长碰到的Crash,通常用于访问了不改访问的内存导致.一般EXC_BAD_ACCESS后面的&qu ...
- android Unhandled exception type ParseException提示报错
Unhandled exception type ParseException 意思指:你有一个方法会抛出异常,但是你没有捕捉. 依提示添加一下即可解决:
- JAVA 新手问题: Request 编码编译出错,Unhandled exception type UnsupportedEncodingException
新手: 编写如下代码 private void Exec(HttpServletRequest Req,HttpServletResponse Response) //throws ServletEx ...
- java-No exception of type ConfigurationException can be thrown; an exception type must be a subclass of Throwable
功能:读配置文件 java菜鸟:导入工程在报名处就开始报错,第一次遇到 import org.apache.commons.lang3.StringUtils; import org.apache.c ...
- Unhandled Exxception “Unhandled exception type IOException”?
Unhandled Exxception “Unhandled exception type IOException”? 在Android studio中,自动遇见这个异常报错,如果eclipse会 ...
- Elasticsearch exception [type=mapper_parsing_exception, reason=No type specified for field [X]
可能原因是实体类属性没有指定映射类型 创建mapping时需要指定field的type,如果不指定则报错 错误 //这是一个类中的字段 @Field(store = false) private St ...
- Android Exception Type "share_dialog_title" is not translated in en, zh-rTW strings
异常出现的场景:打包Android项目时出现 解决办法: Eclipse > Preference > Android > Lint Error Checking搜索Messages ...
- request.get request.GET……
发现他们是不同的. 报错: AttributeError at /add/ 'WSGIRequest' object has no attribute 'get' Request Method: GE ...
随机推荐
- Grunt使用心得
1.安装npm 2.安装CLI ( npm install -g grunt-cli) 3.安装grunt (npm install grunt --save-dev) 4.添加gruntfile.j ...
- Membership修改密码
MembershipUser mu = Membership.GetUser(labelUserName.Text.Trim());//获取资格用户 try { bool flat = mu.Chan ...
- Android学习笔记--AlertDialog应用
1. 自定义实现带图标的TextView IconTextView.java package com.evor.andtest; import android.content.Context; imp ...
- ios打包ipa的四种实用方法(.app转.ipa)-备
感谢大神分享这个博客 总结一下,目前.app包转为.ipa包的方法有以下几种: 1.Apple推荐的方式,即实用xcode的archive功能 Xcode菜单栏->Product->Arc ...
- 变量数据是怎么进ARM中的RAM中?
这篇文章 是从网上复制过来的.觉得不错,分享给大家.原文地址:http://eetrend.com/forum/100028828 ARM的体系结构有很多很多介绍的地方,从其7种模式到CPSR状态寄存 ...
- gitosis使用笔记
gitosis是Git下的权限管理工具,通过一个特殊的仓库(gitosis-admin.git)对Git权限进行管理. 1:服务端安装并配置gitosis (1)通过以下方式获取到安装包 root@w ...
- 如何用VS2010打开VS2012编辑的项目
找到打开项目的开始图标:,右键点击,选择有文本编辑器打开,用下面的语句将文件里面的前两句替换掉.Microsoft Visual Studio Solution File, Format Versi ...
- 自制单片机之七……RS232串口
在我的板子上其它的部分都已完成了,现在就剩下RS232串口了.串口对于单片机很重要,有了它就可以和PC通信了,可以用PC来控制你的单片机,也可以将你单片机上采集的数据传到PC上. 留的位置好像有点挤. ...
- BZOJ1662: [Usaco2006 Nov]Round Numbers
1662: [Usaco2006 Nov]Round Numbers Time Limit: 5 Sec Memory Limit: 64 MBSubmit: 147 Solved: 84[Sub ...
- Linux更换python版本 (转载)
安装完CentOS6.5(Final)后,执行#Python与#python -V,看到版本号是2.6,而且之前写的都是跑在python3.X上面的,3.X和2.X有很多不同,有兴趣的朋友可以参考下这 ...