• 10-Django项目--Ajax请求


    目录

    Ajax请求

    简单示范

    html

    数据添加

    py文件

    html文件

    demo_list.html

    Ajax_data.py


    图例

     

    Ajax请求

    简单示范

    • html

      
      ​
      ​
      
    • py文件

      @csrf_exempt
      def demo_one(request):
          dict_data = {
              "current": 1,
              "limit": 20,
              "count": 82215,
              "list": [
                  {
                      "prodName": "菠萝",
                      "prodCat": "水果",
                      "prodPcat": "其他类",
                      "specInfo": "箱装(上六下六)",
                  }
              ]
          }
          # return HttpResponse(json.dumps(dict_data, ensure_ascii=False))
          return JsonResponse(dict_data)

    数据添加

    • py文件

      class DemoModelFoem(forms.ModelForm):
          class Meta:
              model = models.Demp
              fields = "__all__"
              widgets = {
                  "detail":forms.TextInput
              }
      ​
          def __init__(self, *args, **kwargs):
              super().__init__(*args, **kwargs)
              for name, field in self.fields.items():
                  field.widget.attrs = {"class": "form-control", "autocomplete": "off"}
      ​
      ​
      @csrf_exempt
      def demo_list(request):
          queryset = models.Demp.objects.all()
          form = DemoModelFoem()
          content = {
              "form":form,
              "queryset": queryset
          }
          return render(request, "Ajax-demo/demo_list.html",content)
      ​
      ​
      @csrf_exempt
      def demo_add(request):
          form = DemoModelFoem(request.POST)
          if form.is_valid():
              form.save()
              dict_data = {"status": True}
              return JsonResponse(dict_data)
          dict_data = {"error": form.errors}
          return JsonResponse(dict_data)
    • html文件

      {#添加数据#}
          
             
                 
                     

      任务列表

                 
                 
                     
                        {% for field in form %}                        
                                                            {{ field }}                        
                        {% endfor %}                
                                         
                     
                 
             
         
        {#展示数据#}    
             
                 
                     

      任务展示

                 
                 
                                                                                                                                                                                                                                                                                                                                            {% for data in queryset %}                                                                                                                                                                                                                         ​                                       {% endfor %} ​                                    
      任务ID任务标题任务级别任务内容负责人开始时间任务状态操作
      {{ data.id }}{{ data.title }}{{ data.get_level_display }}{{ data.detail }}{{ data.user.name }}{{ data.times }}{{ data.get_code_display }}                            删除                            修改                        
                 
             
         

    demo_list.html

    1. {% extends "index/index.html" %}
    2. {% load static %}
    3. {% block content %}
    4. <div class="container">
    5. <h1>Ajax演示-oneh1>
    6. <input type="button" id="button-one" class="btn btn-success" value="点我">
    7. <hr>
    8. <table border="1">
    9. <thead>
    10. <th>一级分类th>
    11. <th>二级分类th>
    12. <th>名称th>
    13. thead>
    14. <tbody id="tBody" align="center">tbody>
    15. table>
    16. <h1>Ajax演示-twoh1>
    17. <input type="text" id="username" placeholder="请输入账号">
    18. <input type="text" id="password" placeholder="请输入账号">
    19. <input type="button" id="button-two" class="btn btn-success" value="点我">
    20. <hr>
    21. <h1>Ajax演示-threeh1>
    22. <form id="form-three">
    23. <input type="text" id="name" placeholder="姓名">
    24. <input type="text" id="age" placeholder="年龄">
    25. <input type="text" id="love" placeholder="爱好">
    26. <input type="button" id="button-three" class="btn btn-success" value="点我">
    27. form>
    28. <hr>
    29. div>
    30. <hr>
    31. {#添加数据#}
    32. <div class="container">
    33. <div class="panel panel-warning">
    34. <div class="panel-heading">
    35. <h3 class="panel-title">任务列表h3>
    36. div>
    37. <div class="panel-body">
    38. <form id="formAdd">
    39. {% for field in form %}
    40. <div class="col-xs-6">
    41. <label for="">{{ field.label }}label>
    42. {{ field }}
    43. div>
    44. {% endfor %}
    45. <div class="col-xs-12">
    46. <button type="button" id="btnAdd" class="btn btn-success">提交button>
    47. div>
    48. form>
    49. div>
    50. div>
    51. div>
    52. {#展示数据#}
    53. <div class="container">
    54. <div class="panel panel-danger">
    55. <div class="panel-heading">
    56. <h3 class="panel-title">任务展示h3>
    57. div>
    58. <div class="panel-body">
    59. <table class="table table-bordered">
    60. <thead>
    61. <tr>
    62. <th>任务IDth>
    63. <th>任务标题th>
    64. <th>任务级别th>
    65. <th>任务内容th>
    66. <th>负责人th>
    67. <th>开始时间th>
    68. <th>任务状态th>
    69. <th>操作th>
    70. tr>
    71. thead>
    72. <tbody>
    73. {% for data in queryset %}
    74. <tr>
    75. <th>{{ data.id }}th>
    76. <th>{{ data.title }}th>
    77. <th>{{ data.get_level_display }}th>
    78. <th>{{ data.detail }}th>
    79. <th>{{ data.user.name }}th>
    80. <th>{{ data.times }}th>
    81. <th>{{ data.get_code_display }}th>
    82. <th>
    83. <a href="#">删除a>
    84. <a href="#">修改a>
    85. th>
    86. tr>
    87. {% endfor %}
    88. tbody>
    89. table>
    90. div>
    91. div>
    92. div>
    93. {% endblock %}
    94. {% block js %}
    95. <script>
    96. // 函数调用
    97. $(function () {
    98. bindBtnOne();
    99. bindBtnTwo();
    100. bindBtnThree();
    101. bindBtnEvent();
    102. })
    103. function bindBtnOne() {
    104. // 通过id属性,找见某个标签,之后再点击的时候,触发一个函数
    105. $("#button-one").click(function () {
    106. //在点击这个按钮的时候,进行一次数据提交
    107. $.ajax({
    108. // 请求地址
    109. url: "/demo/one/",
    110. // 请求类型
    111. type: "post",
    112. // 表单数据
    113. data: {
    114. type: "text",
    115. love: "lanqiu"
    116. },
    117. // 如果请求成功,则接受后端传输过来的数据
    118. success: function (res) {
    119. var list = res.list;
    120. var htmlStr = "";
    121. for (var i = 0; i < list.length; i++) {
    122. var emp = list[i]
    123. /*
    124. 水果
    125. 水果
    126. 水果
    127. */
    128. htmlStr += "";
    129. htmlStr += "" + emp.prodCat + ""
    130. htmlStr += "" + emp.prodPcat + ""
    131. htmlStr += "" + emp.prodName + ""
    132. htmlStr += "";
    133. // 通过id定位到一个标签,将html内容添加进去
    134. document.getElementById("tBody").innerHTML = htmlStr;
    135. }
    136. }
    137. })
    138. })
    139. }
    140. function bindBtnTwo() {
    141. // 通过id属性,找见某个标签,之后再点击的时候,触发一个函数
    142. $("#button-two").click(function () {
    143. //在点击这个按钮的时候,进行一次数据提交
    144. $.ajax({
    145. // 请求地址
    146. url: "/demo/two/",
    147. // 请求类型
    148. type: "post",
    149. // 表单数据
    150. data: {
    151. username: $("#username").val(),
    152. password: $("#password").val()
    153. },
    154. // 如果请求成功,则接受后端传输过来的数据
    155. success: function (res) {
    156. alert(res)
    157. }
    158. })
    159. })
    160. }
    161. function bindBtnThree() {
    162. // 通过id属性,找见某个标签,之后再点击的时候,触发一个函数
    163. $("#button-three").click(function () {
    164. //在点击这个按钮的时候,进行一次数据提交
    165. $.ajax({
    166. // 请求地址
    167. url: "/demo/two/",
    168. // 请求类型
    169. type: "post",
    170. // 表单数据
    171. data: $("#form-three").serialize(),
    172. // 如果请求成功,则接受后端传输过来的数据
    173. success: function (res) {
    174. console.log(res)
    175. }
    176. })
    177. })
    178. }
    179. function bindBtnEvent() {
    180. // 通过id属性,找见某个标签,之后再点击的时候,触发一个函数
    181. $("#btnAdd").click(function () {
    182. //在点击这个按钮的时候,进行一次数据提交
    183. $.ajax({
    184. // 请求地址
    185. url: "/demo/add/",
    186. // 请求类型
    187. type: "post",
    188. // 表单数据
    189. data: $("#formAdd").serialize(),
    190. // 如果请求成功,则接受后端传输过来的数据
    191. datatype:"JSON",
    192. success: function (res) {
    193. if(res.status){
    194. alert("添加成功");
    195. }
    196. }
    197. })
    198. })
    199. }
    200. script>
    201. {% endblock %}

     


    Ajax_data.py

    1. # -*- coding:utf-8 -*-
    2. from django.shortcuts import render, redirect, HttpResponse
    3. from django.views.decorators.csrf import csrf_exempt
    4. from demo_one import models
    5. from django.http import JsonResponse
    6. from django import forms
    7. import json
    8. class DemoModelFoem(forms.ModelForm):
    9. class Meta:
    10. model = models.Demp
    11. fields = "__all__"
    12. widgets = {
    13. "detail":forms.TextInput
    14. }
    15. def __init__(self, *args, **kwargs):
    16. super().__init__(*args, **kwargs)
    17. for name, field in self.fields.items():
    18. field.widget.attrs = {"class": "form-control", "autocomplete": "off"}
    19. @csrf_exempt
    20. def demo_list(request):
    21. queryset = models.Demp.objects.all()
    22. form = DemoModelFoem()
    23. content = {
    24. "form":form,
    25. "queryset": queryset
    26. }
    27. return render(request, "Ajax-demo/demo_list.html",content)
    28. @csrf_exempt
    29. def demo_add(request):
    30. form = DemoModelFoem(request.POST)
    31. if form.is_valid():
    32. form.save()
    33. dict_data = {"status": True}
    34. return JsonResponse(dict_data)
    35. dict_data = {"error": form.errors}
    36. return JsonResponse(dict_data)
    37. @csrf_exempt
    38. def demo_one(request):
    39. dict_data = {
    40. "current": 1,
    41. "limit": 20,
    42. "count": 82215,
    43. "list": [
    44. {
    45. "id": 1623704,
    46. "prodName": "菠萝",
    47. "prodCatid": 1187,
    48. "prodCat": "水果",
    49. "prodPcatid": 1211,
    50. "prodPcat": "其他类",
    51. "lowPrice": "2.0",
    52. "highPrice": "3.0",
    53. "avgPrice": "2.5",
    54. "place": "",
    55. "specInfo": "箱装(上六下六)",
    56. "unitInfo": "斤",
    57. "pubDate": "2024-06-04 00:00:00",
    58. "status": "null",
    59. "userIdCreate": 138,
    60. "userIdModified": "null",
    61. "userCreate": "admin",
    62. "userModified": "null",
    63. "gmtCreate": "null",
    64. "gmtModified": "null"
    65. },
    66. {
    67. "id": 1623703,
    68. "prodName": "凤梨",
    69. "prodCatid": 1187,
    70. "prodCat": "水果",
    71. "prodPcatid": 1211,
    72. "prodPcat": "其他类",
    73. "lowPrice": "3.5",
    74. "highPrice": "5.5",
    75. "avgPrice": "4.5",
    76. "place": "国产",
    77. "specInfo": "",
    78. "unitInfo": "斤",
    79. "pubDate": "2024-06-04 00:00:00",
    80. "status": "null",
    81. "userIdCreate": 138,
    82. "userIdModified": "null",
    83. "userCreate": "admin",
    84. "userModified": "null",
    85. "gmtCreate": "null",
    86. "gmtModified": "null"
    87. },
    88. {
    89. "id": 1623702,
    90. "prodName": "圣女果",
    91. "prodCatid": 1187,
    92. "prodCat": "水果",
    93. "prodPcatid": 1211,
    94. "prodPcat": "其他类",
    95. "lowPrice": "4.0",
    96. "highPrice": "5.0",
    97. "avgPrice": "4.5",
    98. "place": "",
    99. "specInfo": "千禧",
    100. "unitInfo": "斤",
    101. "pubDate": "2024-06-04 00:00:00",
    102. "status": "null",
    103. "userIdCreate": 138,
    104. "userIdModified": "null",
    105. "userCreate": "admin",
    106. "userModified": "null",
    107. "gmtCreate": "null",
    108. "gmtModified": "null"
    109. },
    110. {
    111. "id": 1623701,
    112. "prodName": "百香果",
    113. "prodCatid": 1187,
    114. "prodCat": "水果",
    115. "prodPcatid": 1211,
    116. "prodPcat": "其他类",
    117. "lowPrice": "8.0",
    118. "highPrice": "10.0",
    119. "avgPrice": "9.0",
    120. "place": "",
    121. "specInfo": "",
    122. "unitInfo": "斤",
    123. "pubDate": "2024-06-04 00:00:00",
    124. "status": "null",
    125. "userIdCreate": 138,
    126. "userIdModified": "null",
    127. "userCreate": "admin",
    128. "userModified": "null",
    129. "gmtCreate": "null",
    130. "gmtModified": "null"
    131. },
    132. {
    133. "id": 1623700,
    134. "prodName": "九九草莓",
    135. "prodCatid": 1187,
    136. "prodCat": "水果",
    137. "prodPcatid": 1211,
    138. "prodPcat": "其他类",
    139. "lowPrice": "6.0",
    140. "highPrice": "12.0",
    141. "avgPrice": "9.0",
    142. "place": "",
    143. "specInfo": "",
    144. "unitInfo": "斤",
    145. "pubDate": "2024-06-04 00:00:00",
    146. "status": "null",
    147. "userIdCreate": 138,
    148. "userIdModified": "null",
    149. "userCreate": "admin",
    150. "userModified": "null",
    151. "gmtCreate": "null",
    152. "gmtModified": "null"
    153. },
    154. {
    155. "id": 1623699,
    156. "prodName": "杨梅",
    157. "prodCatid": 1187,
    158. "prodCat": "水果",
    159. "prodPcatid": 1211,
    160. "prodPcat": "其他类",
    161. "lowPrice": "8.0",
    162. "highPrice": "19.0",
    163. "avgPrice": "13.5",
    164. "place": "",
    165. "specInfo": "",
    166. "unitInfo": "斤",
    167. "pubDate": "2024-06-04 00:00:00",
    168. "status": "null",
    169. "userIdCreate": 138,
    170. "userIdModified": "null",
    171. "userCreate": "admin",
    172. "userModified": "null",
    173. "gmtCreate": "null",
    174. "gmtModified": "null"
    175. },
    176. {
    177. "id": 1623698,
    178. "prodName": "蓝莓",
    179. "prodCatid": 1187,
    180. "prodCat": "水果",
    181. "prodPcatid": 1211,
    182. "prodPcat": "其他类",
    183. "lowPrice": "25.0",
    184. "highPrice": "45.0",
    185. "avgPrice": "35.0",
    186. "place": "",
    187. "specInfo": "",
    188. "unitInfo": "斤",
    189. "pubDate": "2024-06-04 00:00:00",
    190. "status": "null",
    191. "userIdCreate": 138,
    192. "userIdModified": "null",
    193. "userCreate": "admin",
    194. "userModified": "null",
    195. "gmtCreate": "null",
    196. "gmtModified": "null"
    197. },
    198. {
    199. "id": 1623697,
    200. "prodName": "火龙果",
    201. "prodCatid": 1187,
    202. "prodCat": "水果",
    203. "prodPcatid": 1211,
    204. "prodPcat": "其他类",
    205. "lowPrice": "7.0",
    206. "highPrice": "11.0",
    207. "avgPrice": "9.0",
    208. "place": "",
    209. "specInfo": "红",
    210. "unitInfo": "斤",
    211. "pubDate": "2024-06-04 00:00:00",
    212. "status": "null",
    213. "userIdCreate": 138,
    214. "userIdModified": "null",
    215. "userCreate": "admin",
    216. "userModified": "null",
    217. "gmtCreate": "null",
    218. "gmtModified": "null"
    219. },
    220. {
    221. "id": 1623696,
    222. "prodName": "火龙果",
    223. "prodCatid": 1187,
    224. "prodCat": "水果",
    225. "prodPcatid": 1211,
    226. "prodPcat": "其他类",
    227. "lowPrice": "5.3",
    228. "highPrice": "7.3",
    229. "avgPrice": "6.3",
    230. "place": "",
    231. "specInfo": "白",
    232. "unitInfo": "斤",
    233. "pubDate": "2024-06-04 00:00:00",
    234. "status": "null",
    235. "userIdCreate": 138,
    236. "userIdModified": "null",
    237. "userCreate": "admin",
    238. "userModified": "null",
    239. "gmtCreate": "null",
    240. "gmtModified": "null"
    241. },
    242. {
    243. "id": 1623695,
    244. "prodName": "木瓜",
    245. "prodCatid": 1187,
    246. "prodCat": "水果",
    247. "prodPcatid": 1211,
    248. "prodPcat": "其他类",
    249. "lowPrice": "4.5",
    250. "highPrice": "5.0",
    251. "avgPrice": "4.75",
    252. "place": "",
    253. "specInfo": "",
    254. "unitInfo": "斤",
    255. "pubDate": "2024-06-04 00:00:00",
    256. "status": "null",
    257. "userIdCreate": 138,
    258. "userIdModified": "null",
    259. "userCreate": "admin",
    260. "userModified": "null",
    261. "gmtCreate": "null",
    262. "gmtModified": "null"
    263. },
    264. {
    265. "id": 1623694,
    266. "prodName": "桑葚",
    267. "prodCatid": 1187,
    268. "prodCat": "水果",
    269. "prodPcatid": 1211,
    270. "prodPcat": "其他类",
    271. "lowPrice": "6.0",
    272. "highPrice": "9.0",
    273. "avgPrice": "7.5",
    274. "place": "",
    275. "specInfo": "",
    276. "unitInfo": "斤",
    277. "pubDate": "2024-06-04 00:00:00",
    278. "status": "null",
    279. "userIdCreate": 138,
    280. "userIdModified": "null",
    281. "userCreate": "admin",
    282. "userModified": "null",
    283. "gmtCreate": "null",
    284. "gmtModified": "null"
    285. },
    286. {
    287. "id": 1623693,
    288. "prodName": "柠檬",
    289. "prodCatid": 1187,
    290. "prodCat": "水果",
    291. "prodPcatid": 1211,
    292. "prodPcat": "其他类",
    293. "lowPrice": "3.0",
    294. "highPrice": "4.0",
    295. "avgPrice": "3.5",
    296. "place": "",
    297. "specInfo": "",
    298. "unitInfo": "斤",
    299. "pubDate": "2024-06-04 00:00:00",
    300. "status": "null",
    301. "userIdCreate": 138,
    302. "userIdModified": "null",
    303. "userCreate": "admin",
    304. "userModified": "null",
    305. "gmtCreate": "null",
    306. "gmtModified": "null"
    307. },
    308. {
    309. "id": 1623692,
    310. "prodName": "姑娘果(灯笼果)",
    311. "prodCatid": 1187,
    312. "prodCat": "水果",
    313. "prodPcatid": 1211,
    314. "prodPcat": "其他类",
    315. "lowPrice": "12.5",
    316. "highPrice": "25.0",
    317. "avgPrice": "18.75",
    318. "place": "",
    319. "specInfo": "",
    320. "unitInfo": "斤",
    321. "pubDate": "2024-06-04 00:00:00",
    322. "status": "null",
    323. "userIdCreate": 138,
    324. "userIdModified": "null",
    325. "userCreate": "admin",
    326. "userModified": "null",
    327. "gmtCreate": "null",
    328. "gmtModified": "null"
    329. },
    330. {
    331. "id": 1623691,
    332. "prodName": "鸭梨",
    333. "prodCatid": 1187,
    334. "prodCat": "水果",
    335. "prodPcatid": "null",
    336. "prodPcat": "梨类",
    337. "lowPrice": "1.8",
    338. "highPrice": "2.0",
    339. "avgPrice": "1.9",
    340. "place": "",
    341. "specInfo": "",
    342. "unitInfo": "斤",
    343. "pubDate": "2024-06-04 00:00:00",
    344. "status": "null",
    345. "userIdCreate": 138,
    346. "userIdModified": "null",
    347. "userCreate": "admin",
    348. "userModified": "null",
    349. "gmtCreate": "null",
    350. "gmtModified": "null"
    351. },
    352. {
    353. "id": 1623690,
    354. "prodName": "雪花梨",
    355. "prodCatid": 1187,
    356. "prodCat": "水果",
    357. "prodPcatid": "null",
    358. "prodPcat": "梨类",
    359. "lowPrice": "1.6",
    360. "highPrice": "1.8",
    361. "avgPrice": "1.7",
    362. "place": "",
    363. "specInfo": "",
    364. "unitInfo": "斤",
    365. "pubDate": "2024-06-04 00:00:00",
    366. "status": "null",
    367. "userIdCreate": 138,
    368. "userIdModified": "null",
    369. "userCreate": "admin",
    370. "userModified": "null",
    371. "gmtCreate": "null",
    372. "gmtModified": "null"
    373. },
    374. {
    375. "id": 1623689,
    376. "prodName": "皇冠梨",
    377. "prodCatid": 1187,
    378. "prodCat": "水果",
    379. "prodPcatid": "null",
    380. "prodPcat": "梨类",
    381. "lowPrice": "2.7",
    382. "highPrice": "2.8",
    383. "avgPrice": "2.75",
    384. "place": "",
    385. "specInfo": "纸箱",
    386. "unitInfo": "斤",
    387. "pubDate": "2024-06-04 00:00:00",
    388. "status": "null",
    389. "userIdCreate": 138,
    390. "userIdModified": "null",
    391. "userCreate": "admin",
    392. "userModified": "null",
    393. "gmtCreate": "null",
    394. "gmtModified": "null"
    395. },
    396. {
    397. "id": 1623688,
    398. "prodName": "丰水梨",
    399. "prodCatid": 1187,
    400. "prodCat": "水果",
    401. "prodPcatid": "null",
    402. "prodPcat": "梨类",
    403. "lowPrice": "2.8",
    404. "highPrice": "3.1",
    405. "avgPrice": "2.95",
    406. "place": "",
    407. "specInfo": "",
    408. "unitInfo": "斤",
    409. "pubDate": "2024-06-04 00:00:00",
    410. "status": "null",
    411. "userIdCreate": 138,
    412. "userIdModified": "null",
    413. "userCreate": "admin",
    414. "userModified": "null",
    415. "gmtCreate": "null",
    416. "gmtModified": "null"
    417. },
    418. {
    419. "id": 1623687,
    420. "prodName": "酥梨",
    421. "prodCatid": 1187,
    422. "prodCat": "水果",
    423. "prodPcatid": "null",
    424. "prodPcat": "梨类",
    425. "lowPrice": "2.0",
    426. "highPrice": "2.5",
    427. "avgPrice": "2.25",
    428. "place": "",
    429. "specInfo": "",
    430. "unitInfo": "斤",
    431. "pubDate": "2024-06-04 00:00:00",
    432. "status": "null",
    433. "userIdCreate": 138,
    434. "userIdModified": "null",
    435. "userCreate": "admin",
    436. "userModified": "null",
    437. "gmtCreate": "null",
    438. "gmtModified": "null"
    439. },
    440. {
    441. "id": 1623686,
    442. "prodName": "库尔勒香梨",
    443. "prodCatid": 1187,
    444. "prodCat": "水果",
    445. "prodPcatid": "null",
    446. "prodPcat": "梨类",
    447. "lowPrice": "3.5",
    448. "highPrice": "5.9",
    449. "avgPrice": "4.7",
    450. "place": "",
    451. "specInfo": "",
    452. "unitInfo": "斤",
    453. "pubDate": "2024-06-04 00:00:00",
    454. "status": "null",
    455. "userIdCreate": 138,
    456. "userIdModified": "null",
    457. "userCreate": "admin",
    458. "userModified": "null",
    459. "gmtCreate": "null",
    460. "gmtModified": "null"
    461. },
    462. {
    463. "id": 1623685,
    464. "prodName": "红香酥梨",
    465. "prodCatid": 1187,
    466. "prodCat": "水果",
    467. "prodPcatid": "null",
    468. "prodPcat": "梨类",
    469. "lowPrice": "2.5",
    470. "highPrice": "2.6",
    471. "avgPrice": "2.55",
    472. "place": "",
    473. "specInfo": "",
    474. "unitInfo": "斤",
    475. "pubDate": "2024-06-04 00:00:00",
    476. "status": "null",
    477. "userIdCreate": 138,
    478. "userIdModified": "null",
    479. "userCreate": "admin",
    480. "userModified": "null",
    481. "gmtCreate": "null",
    482. "gmtModified": "null"
    483. }
    484. ]
    485. }
    486. # return HttpResponse(json.dumps(dict_data, ensure_ascii=False))
    487. return JsonResponse(dict_data)
    488. @csrf_exempt
    489. def demo_two(request):
    490. dict_data = {
    491. "start": True
    492. }
    493. return JsonResponse(dict_data)

     

  • 相关阅读:
    [附源码]Python计算机毕业设计宠物销售管理系统
    【 OpenGauss源码学习 —— (hash_search)】
    优雅退出在Golang中的实现
    雷电模拟器上使用第一个frida(二)之su超级权限
    Python中使用cv2.resize()函数批量自定义缩放图像尺寸
    37. UE5 RPG创建自定义的Ability Task
    DP31 买卖股票的最好时机(二)、(三)、(四)
    SQL基础理论篇(九):存储过程
    ChartDirector 7.1 for .NET Crack
    工厂设计模式
  • 原文地址:https://blog.csdn.net/2303_80857229/article/details/139455835