摘要: import requests,pprint,time #代码调试,增删改查 # t=time.time() # print(t) # response = requests.get('http://localhost/api/mgr/customers?action=list_customer') 阅读全文
posted @ 2021-04-28 14:44 大川哥 阅读(60) 评论(0) 推荐(0) 编辑
摘要: def listmedicine(request): try: # .order_by('-id') 表示按照 id字段的值 倒序排列 # 这样可以保证最新的记录显示在最前面 qs = Medicine.objects.values().order_by('-id') # 查看是否有 关键字 搜索 阅读全文
posted @ 2021-04-28 14:36 大川哥 阅读(80) 评论(0) 推荐(0) 编辑
摘要: from django.http import JsonResponse from django.db.models import F from django.db import IntegrityError, transaction import traceback # 导入 Order 对象定义 阅读全文
posted @ 2021-04-28 14:31 大川哥 阅读(117) 评论(0) 推荐(0) 编辑
摘要: from django.http import JsonResponse from django.contrib.auth import authenticate,login,logout # 登录处理 def signin(request): # 从 HTTP POST 请求中获取用户名、密码参数 阅读全文
posted @ 2021-04-28 14:29 大川哥 阅读(186) 评论(0) 推荐(0) 编辑
摘要: 在项目的配置文件 settings.py 中, INSTALLED_APPS 配置项 加入如下内容 INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'dj 阅读全文
posted @ 2021-04-28 14:28 大川哥 阅读(98) 评论(0) 推荐(0) 编辑