"错误提示信息":

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. Java实现生产者消费者问题与读者写者问题

    摘要: Java实现生产者消费者问题与读者写者问题 1.生产者消费者问题 生产者消费者问题是研究多线程程序时绕不开的经典问题之一,它描述是有一块缓冲区作为仓库,生产者可以将产品放入仓库,消费者则可以从 ...

  2. 文成小盆友python-num4 装饰器,内置函数

    一 .python 内置函数补充 chr()  -- 返回所给参数对应的 ASCII 对应的字符,与ord()相反 # -*- coding:utf-8 -*- # Author:wencheng.z ...

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

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

  4. Jetty开发(2)

    部署web应用 配置了部署模块的Jetty服务器实例能够在webapps目录下热部署web应用.在webapps目录下标准的War包和jetty的配置文件能够被热部署进服务器需要符合下述规则: exa ...

  5. NET Core依赖注入解读&使用Autofac替代实现

    NET Core依赖注入解读&使用Autofac替代实现 标签: 依赖注入 Autofac ASPNETCore ASP.NET Core依赖注入解读&使用Autofac替代实现 1. ...

  6. JAVA_build_ant_cmd pass muti param

    ant -f buildFileName -Dpropretyname1=value1  -Dpropretyname2=value2 ant [options] [target [target2 [ ...

  7. BZOJ2101: [Usaco2010 Dec]Treasure Chest 藏宝箱

    2101: [Usaco2010 Dec]Treasure Chest 藏宝箱 Time Limit: 10 Sec  Memory Limit: 64 MBSubmit: 327  Solved:  ...

  8. 图论:2-SAT模板

    #include<cstdio> #include<vector> #include<cstring> using namespace std; const int ...

  9. Spring 的优秀工具类盘点第 1 部分

    文件资源操作 文件资源的操作是应用程序中常见的功能,如当上传一个文件后将其保存在特定目录下,从指定地址加载一个配置文件等等.我们一般使用 JDK 的 I/O 处理类完成这些操作,但对于一般的应用程序来 ...

  10. poj 2566 Bound Found(尺取法 好题)

    Description Signals of most probably extra-terrestrial origin have been received and digitalized by ...