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 ...
随机推荐
- 转载:如何查看用户当前shell和修改用户登陆时的默认shell
转载网址:http://www.51testing.com/html/44/211244-197042.html 1.查看当前使用的shell类型 # echo $SHELL/usr/bin/bs ...
- shopnc B2B2C商城 Nginx下开启伪静态
B2B2C商城 Nginx下开启伪静态,伪静态开启后,对系统的SEO极为有利,可以最大限度让商城页面被搜索引擎抓取,但在实际安装中,很多客户在这块都会遇到各种各样的问题. 1. 编辑商城配置文件(da ...
- Python新手学习基础之函数-概念与定义
什么是函数? 函数是可以实现一些特定功能的方法或是程序,简单的理解下函数的概念,就是你编写了一些语句,为了方便使用,把这些语句组合在一起,给它起一个名字,即函数名.使用的时候只要调用这个名字,就可以实 ...
- 2016年最受欢迎中国开源软件TOP 20
开源软件对程序员来说是一个经常接触的软件,作为一个经常接触的软件,当然想知道自己用的软件受欢迎程度,基于此,开源中国在近日公布“2016年度最受欢迎中国开源软件评选”结果,在TOP20榜单中,前5名分 ...
- jquery easyui根据需求二次开发记录
1.tree需要显示多个图标 实际需求:设备树上节点需搁三个图片,分别标识运行状态.告警状态.设备类型 解决方法:给tree的iconCls传入一个数组,分别是各状态下的class(css),然后要改 ...
- Delphi7下实现HTTP的Post操作 转
Delphi7下实现HTTP的Post操作 unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Gra ...
- JVM基础和调优(三)
主要讲解垃圾回收的算法 上面我们已经了解到了,JVM的体系的结构,这次我们来说一下垃圾回收的算法. 1. 最开始的想法,或者说垃圾回收的最容易想到的就是:引用计数(reference count) 我 ...
- Excel2010 柱形图与折线图制表
示例1: 数据格式 问题:现在要用柱形图表示手机网民数和年增长率,横轴表示年份,纵轴(1)表示手机网民数,纵轴折线图(2)表示年增长率,要做在一个图表中,请问该怎么做? 步骤: 1.选择A/B/C所在 ...
- 第19讲- UI组件之_Button、checkbox、radio
第19讲 UI组件之_Button.checkbox.radio 四.按钮Button Button继承自TextView,间接继承自View.当用户对按钮进行操作的时候,触发相应事件,如点击,触摸. ...
- pyqt学习之列表管理器(网友提供)
# -*- coding: utf-8 -*- __author__ = 'Administrator' import sys from PyQt4.QtCore import * from PyQt ...