request.get request.GET……
发现他们是不同的。
报错:
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', |
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……的更多相关文章
- String path = request.getContextPath(); String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";作用!!!!!
<%String path = request.getContextPath();String basePath = request.getScheme()+"://"+re ...
- C#中 Request, Request.params , Request.querystring , Request.Form 区别 与联系用法
C#中 Request, Request.params , Request.querystring , Request.Form 区别 与联系用法? Request.params , Request ...
- basePath = request.getScheme()+"://"+request.getServerName()+":"+r
basePath = request.getScheme()+"://"+request.getServerName()+":"+r (2014-06-30 1 ...
- String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+pat----------<base>元素有关
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request. ...
- 客户端的数据来源:QueryString, Form, Cookie Request[]与Request.Params[]
在ASP.NET编程中,有三个比较常见的来自于客户端的数据来源:QueryString, Form, Cookie . 我们可以在HttpRequest中访问这三大对象. QueryString: 获 ...
- JSP之项目路径问题(${pageContext.request.contextPath},<%=request.getContextPath()%>以及绝对路径获取)
本随笔这是作为一个记录使用,以备后查.项目完成之后本地部署OK,本地Linux部署OK,都可以正常的访问,可是当我把它部署到服务器上面的时候,首页可以正常访问,可是当发出请求的时候却报错误了,说找不到 ...
- 安卓开发笔记(十六):'Request(okhttp3.Request.Builder)' has private access in 'okhttp3.Request
当出现了'Request(okhttp3.Request.Builder)' has private access in 'okhttp3.Request的错误的时候,实际上是我们在写代码的时候少打了 ...
- <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %>
<%String path = request.getContextPath();String basePath = request.getScheme()+"://"+re ...
- [转载]Request、Request.Form和Request.QueryString的区别
Request.Request.Form和Request.QueryString的区别 request本身是一个系统的静态对象,本身也可以作为数组调用,比如request("abc" ...
随机推荐
- Codeforces Round #210 (Div. 2) C. Levko and Array Recovery
题目链接 线段树的逆过程,想了老一会,然后发现应该是包含区间对存在有影响,就不知怎么做了...然后尚大神,说,So easy,你要倒着来,然后再正着来,判断是不是合法就行了.然后我乱写了写,就过了.数 ...
- Vijos 1092 全排列
题目链接 来个水题..难得的1Y. #include <cstdio> #include <cstring> #include <iostream> using n ...
- BZOJ4546: codechef XRQRS
Description 给定一个初始时为空的整数序列(元素由1开始标号)以及一些询问: 类型1:在数组后面就加入数字x. 类型2:在区间L…R中找到y,最大化(x xor y). 类型3:删除数组最后 ...
- 如何更改tableView cell的accessoryView位置,如何让首尾的Separator不显示
一,如何更改tableView cell的accessoryView位置 1.实则是更改不了的,因此右边总会有一个小边距. 2.可以向 cell 的 contentView 中添加按钮放在右边,与 c ...
- 优化UITableViewCell高度计算的那些事
优化UITableViewCell高度计算的那些事 我是前言 这篇文章是我和我们团队最近对 UITableViewCell 利用 AutoLayout 自动高度计算和 UITableView 滑动优化 ...
- Maven_pom.xml介绍
Maven的pom.xml介绍 6.1 简介 pom.xml文件是Maven进行工作的主要配置文件.在这个文件中我们可以配置Maven项目的groupId.artifactId和version ...
- OO与设计模式的原则、目标
OO与设计模式的原则.目标(转) 前两天,和一朋友聊到OO设计原则时,对设计模式有了更深的了解,在这里总结一下,与大家分享.OO(Object–Oriented )面向对象 OO方法(Object ...
- linux下的crontab服务
linux下的crontab服务:1.crontab 是用来让使用者在固定时间或固定间隔执行程序之用在linux平台上如果需要实现任务调度功能可以编写cron脚本来实现.以某一频率执行任务linux缺 ...
- uva 1382 - Distant Galaxy
题目连接:http://acm.hust.edu.cn/vjudge/contest/view.action?cid=91208#problem/G 题意: 给出平面上的n个点,找出一个矩形,使得边 ...
- error while loading shared libraries: libXXX.so.x: cannot open shared object file: No such file or directory .
转载:http://www.eefocus.com/pengwr/blog/2012-02/235057_baf52.html 此时你可以locate libXXX.so.x 一下,查看系统里是否有该 ...