1. 自定义返回请求值的函数
def render_json(data, status=200):
return HttpResponse(json.dumps(data), content_type="text/json", status=status)
def render_json_error(message, status=400):
return render_json(message, status) …
def render_json(data, status=200):
return HttpResponse(json.dumps(data), content_type="text/json", status=status)
def render_json_error(message, status=400):
return render_json(message, status) …
1.capitalize():字符串首字符大写
>>> string = 'this is a string.'
>>> string.capitalize()
This is a string.
2.center(width, …
!doctype>