"错误提示信息":

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/的更多相关文章

  1. (学)解决诡异的 Exception type: SocketException 127.0.0.1:80

    许久不发博了,老杨听完故事让我持续写一下“十万个为什么” 一.背景:  昨天我们亲密的战友HH刘老板亲临现场,指出我们协用的一个项目,客户方面反馈手持终端系统不定期“卡死”,要我们安排人飞到广州驻场解 ...

  2. Exception Type & Exception Code

    1.Exception Type 1)EXC_BAD_ACCESS 此类型的Excpetion是我们最长碰到的Crash,通常用于访问了不改访问的内存导致.一般EXC_BAD_ACCESS后面的&qu ...

  3. android Unhandled exception type ParseException提示报错

    Unhandled exception type ParseException 意思指:你有一个方法会抛出异常,但是你没有捕捉. 依提示添加一下即可解决:

  4. JAVA 新手问题: Request 编码编译出错,Unhandled exception type UnsupportedEncodingException

    新手: 编写如下代码 private void Exec(HttpServletRequest Req,HttpServletResponse Response) //throws ServletEx ...

  5. 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 ...

  6. Unhandled Exxception “Unhandled exception type IOException”?

    Unhandled Exxception  “Unhandled exception type IOException”? 在Android studio中,自动遇见这个异常报错,如果eclipse会 ...

  7. Elasticsearch exception [type=mapper_parsing_exception, reason=No type specified for field [X]

    可能原因是实体类属性没有指定映射类型 创建mapping时需要指定field的type,如果不指定则报错 错误 //这是一个类中的字段 @Field(store = false) private St ...

  8. Android Exception Type "share_dialog_title" is not translated in en, zh-rTW strings

    异常出现的场景:打包Android项目时出现 解决办法: Eclipse > Preference > Android > Lint Error Checking搜索Messages ...

  9. request.get request.GET……

    发现他们是不同的. 报错: AttributeError at /add/ 'WSGIRequest' object has no attribute 'get' Request Method: GE ...

随机推荐

  1. Oracle字符串分割函数

    今天在创建视图的时候,碰到一个问题,问题如下: 将字符格式为“XXX,YYY”分割出来,并且分割后作为两个字段放入视图中. 考虑使用字符分割函数,但是查找资料Oracle没有字符分割的函数(我对Ora ...

  2. Python新手学习基础之数据类型——字符串的切片截取

    切片截取是python中字符串常见的一些操作,我们会在这篇文章里详细介绍,切片截取的作用是获取子字符或子字符串. 实际上,我们要做的就是使用索引,用冒号分隔两个索引,形式为:变量[头下标:尾下标],冒 ...

  3. mac下 配置tomcat

    第一步: 1.打开你的终端:然后输入  pico .bash_profile   回车 第二步: 2. 然后添加你tomcat放入的路径的path 编辑完后,control+x   (保存)    继 ...

  4. (摘)ORACLE DBA的职责

    ORACLE数据库管理员应按如下方式对ORACLE数据库系统做定期监控: (1). 每天对ORACLE数据库的运行状态,日志文件,备份情况,数据 库的空间使用情况,系统资源的使用情况进行检查,发现并解 ...

  5. document.body.scrollTop vs document.documentElement.scrollTop

    window.addEventListener("scroll", function () { if (document.body.scrollTop >= window.i ...

  6. 在WPF中使用AForge.net控制摄像头拍照

    原文:在WPF中使用AForge.net控制摄像头拍照 利用AForge.net控制摄像头拍照最方便的方法就是利用PictureBox显示摄像头画面,但在WPF中不能直接使用PictureBox.必须 ...

  7. linux 文件内容的复制

    #include <string.h> #include <strings.h> #include <stdio.h> #include <stdlib.h& ...

  8. FutureTask 测试用例

    package currentTest.BlockingQueue; import java.util.concurrent.Callable; import java.util.concurrent ...

  9. Centos 6.5中安装后不能打开emacs的问题

    问题的发现过程: 安装了最新的centos版本后发现居然打不开emacs,然后在终端中输入emacs后还是不能打开,出现了下面的提示: emacs: error while loading share ...

  10. PHP常用魔术方法(__call魔术方法:)

    魔术方法  __call <?php //文件名:index.php define('a',__DIR__); include '/IMooc/Loader.php'; spl_autoload ...