# 浏览器中使用javascript发起ajax请求时,返回json格式的数据,此处以jquery的get()方法为例; # 类JsonResponse继承自HttpResponse对象,被定义在django.http模块中.接收字典作为参数; # JsonResponse对象的content-ty... ...
分类:
Web程序 时间:
2017-10-26 15:23:52
阅读次数:
333
http请求中产生的两个核心对象 http请求: HttpRequest http响应: HttpResponse 所在位置 django.http httpRequest属性: HttpRequest.path 请求页面的全路径,不包含域名 完整的请求路径,不包括域 例: "/music/band ...
分类:
其他好文 时间:
2017-10-24 11:36:20
阅读次数:
531
#根据名称反向生成url from django.conf.urls import url,include from django.contrib import admin from django.shortcuts import HttpResponse,redirect from app01 i ...
分类:
其他好文 时间:
2017-10-23 20:42:47
阅读次数:
206
上周五老师开的会,不知不觉就飘过一周了,改写总结了。。。。时间有如白驹过隙,一发不可收拾啊! 一、JSP内置对象 1、JSP简介 JSP本质即为servlet,是简化的servlet设计,运行于web容器中(容器的概念?),接收Httprequest,返回Httpresponse; 服务器web容器 ...
分类:
其他好文 时间:
2017-10-18 23:44:42
阅读次数:
384
HTTPResponse 注意一个常用方法:request.POST.getlist('') 2 HttpResponse对象: 对于HttpRequest对象来说,是由django自动创建的,但是,HttpResponse对象就必须我们自己创建。每个view请求处理方法必须返回一个HttpResp ...
分类:
其他好文 时间:
2017-10-18 10:14:42
阅读次数:
166
1 HttpContext上下文作用 有关应用程序状态信息,处理的请求以及构建的响应等信息全部通过HttpContext上下文获取 2 Httpcontext类用于从头至尾跟踪请求的状态,他也是有关请求的所有可用信息(包括httpRequest和httpResponse对象)的通道 3 模块 模块将 ...
分类:
Web程序 时间:
2017-10-12 21:36:29
阅读次数:
216
知识点1:HttpResponse 与 JsonResponse 的区别? HttpResponse (json.dumps(字典或者列表)) JsonResponse (只能是字典,不能是列表!),如果非要写列表,那么加上属性safe >JsonResponse (列表,safe=False) j ...
分类:
数据库 时间:
2017-10-12 15:00:17
阅读次数:
224
from django.http import HttpResponse from django.conf.urls import url from django.conf import settings import sys settings.configure( DEBUG = True, SE... ...
分类:
其他好文 时间:
2017-10-10 13:07:18
阅读次数:
146
import hashlib import time from django.http import HttpResponse key="qwrwertyuiop" visited_key={ #'key':time } def api_auth(func): def inner(request,*... ...
from django.shortcuts import render,HttpResponse import json # Create your views here. from repository import models from aip.plugins import Plugins d ...
分类:
其他好文 时间:
2017-10-01 20:36:30
阅读次数:
249