发现他们是不同的。

报错:

AttributeError at /add/

'WSGIRequest' object has no attribute 'get'
Request Method: GET
Request URL: http://127.0.0.1:8000/add/?a=4&b=5
Django Version: 1.11
Exception Type: AttributeError
Exception Value:
'WSGIRequest' object has no attribute 'get'
Exception Location: D:\hack\Python\我的学习\Django\web1\calc\views.py in add, line 5
Python Executable: C:\Users\jumz-G\AppData\Local\Programs\Python\Python35-32\python.exe
Python Version: 3.5.0
Python Path:
['D:\\hack\\Python\\我的学习\\Django\\web1',
'C:\\Users\\jumz-G\\AppData\\Local\\Programs\\Python\\Python35-32\\lib\\site-packages\\django-1.11-py3.5.egg',
'C:\\Users\\jumz-G\\AppData\\Local\\Programs\\Python\\Python35-32\\lib\\site-packages\\pytz-2016.10-py3.5.egg',
'C:\\Users\\jumz-G\\AppData\\Local\\Programs\\Python\\Python35-32\\python35.zip',
'C:\\Users\\jumz-G\\AppData\\Local\\Programs\\Python\\Python35-32\\DLLs',
'C:\\Users\\jumz-G\\AppData\\Local\\Programs\\Python\\Python35-32\\lib',
'C:\\Users\\jumz-G\\AppData\\Local\\Programs\\Python\\Python35-32',
'C:\\Users\\jumz-G\\AppData\\Local\\Programs\\Python\\Python35-32\\lib\\site-packages']
Server time: Sat, 24 Dec 2016 10:54:04 +0000

不知道这里什么意思

反正在这里必须要大写……

from django.http import HttpResponse
def add(request):
    a=request.GET['a']
    b=request.get['b']
    c=str(int(a)+int(b))
    return HttpResponse(c)

request.get request.GET……的更多相关文章

  1. String path = request.getContextPath(); String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";作用!!!!!

    <%String path = request.getContextPath();String basePath = request.getScheme()+"://"+re ...

  2. C#中 Request, Request.params , Request.querystring , Request.Form 区别 与联系用法

    C#中 Request, Request.params , Request.querystring , Request.Form 区别 与联系用法? Request.params , Request ...

  3. basePath = request.getScheme()+"://"+request.getServerName()+":"+r

    basePath = request.getScheme()+"://"+request.getServerName()+":"+r (2014-06-30 1 ...

  4. String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+pat----------<base>元素有关

    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request. ...

  5. 客户端的数据来源:QueryString, Form, Cookie Request[]与Request.Params[]

    在ASP.NET编程中,有三个比较常见的来自于客户端的数据来源:QueryString, Form, Cookie . 我们可以在HttpRequest中访问这三大对象. QueryString: 获 ...

  6. JSP之项目路径问题(${pageContext.request.contextPath},<%=request.getContextPath()%>以及绝对路径获取)

    本随笔这是作为一个记录使用,以备后查.项目完成之后本地部署OK,本地Linux部署OK,都可以正常的访问,可是当我把它部署到服务器上面的时候,首页可以正常访问,可是当发出请求的时候却报错误了,说找不到 ...

  7. 安卓开发笔记(十六):'Request(okhttp3.Request.Builder)' has private access in 'okhttp3.Request

    当出现了'Request(okhttp3.Request.Builder)' has private access in 'okhttp3.Request的错误的时候,实际上是我们在写代码的时候少打了 ...

  8. <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %>

    <%String path = request.getContextPath();String basePath = request.getScheme()+"://"+re ...

  9. [转载]Request、Request.Form和Request.QueryString的区别

    Request.Request.Form和Request.QueryString的区别 request本身是一个系统的静态对象,本身也可以作为数组调用,比如request("abc" ...

随机推荐

  1. HDU 3720 Arranging Your Team(DFS)

    题目链接 队内赛里,匆匆忙忙写的. #include <cstdio> #include <cstring> #include <iostream> #includ ...

  2. BZOJ4531: [Bjoi2014]路径

    Description 在一个N个节点的无向图(没有自环.重边)上,每个点都有一个符号, 可能是数字,也可能是加号.减号.乘号.除号.小括号.你要在这个图上数 一数,有多少种走恰好K个节点的方法,使得 ...

  3. 初识WebSocket

    众所周知,Http协议是无状态的,并且是基于Request/Response的方式与服务器进行交互,也就是我们常说的单工模式.但是随着互联 网的发展,浏览器与服务端进行双向通信需求的增加,长轮询向服务 ...

  4. Oracle 客户端免安装数据库连接

    PLSQL Developer 连接数据库需要安装Oracle客户端,在这里介绍一种Oracle客户端解压式安装,而不是exe安装. 安装步骤: 1:确定客户端安装所在主机的系统位数 2:选择正确的客 ...

  5. 打开FileGeoDatabase中要素类

    private IFeatureClass OpenFileGdbFtCls(string fn) { IFeatureClass pftcls = null; IWorkspaceFactory w ...

  6. 注入语句详解(get注入,cookie注入,搜索型注入等)

    注意:对于普通的get注入,如果是字符型,前加'   后加 and ''=' 拆半法 ###################################### and exists (select ...

  7. spring security防御会话伪造session攻击

    1. 攻击场景 session fixation会话伪造攻击是一个蛮婉转的过程. 比如,当我要是使用session fixation攻击你的时候,首先访问这个网站,网站会创建一个会话,这时我可以把附有 ...

  8. 用session实现简单的购物

    package cn.itcast.shopping; import java.io.IOException; import java.io.PrintWriter; import java.util ...

  9. ServletConfig对象和它在开发中的应用场

    package cn.itcast; import java.io.IOException; import java.io.PrintWriter; import java.util.Enumerat ...

  10. asp.net identity 2.2.0 中角色启用和基本使用(五)

    建立控制器UsersAdminController 第一步:在controllers文件夹上点右键>添加>控制器, 我这里选的是“MVC5 控制器-空”,名称设置为:UsersAdminC ...