摘要: 1.若发送数据Data是字符串或者数字时: $.ajax({ url:'/edit_student/', type:'POST', data:Data, dataType:'JSON', //内部自动执行var dict = JSON.parse(arg); success:function (ar 阅读全文
posted @ 2020-06-05 10:50 丑丑的大灰狼 阅读(636) 评论(0) 推荐(0)
摘要: from django.db import models class Classes(models.Model): """ 班级表,男 """ titile = models.CharField(max_length=32) m = models.ManyToManyField('Teachers' 阅读全文
posted @ 2020-06-01 11:25 丑丑的大灰狼 阅读(150) 评论(0) 推荐(0)
摘要: 1.Django默认支持sqlite数据库 DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), } } 若要建立MySQL数据 阅读全文
posted @ 2020-05-27 11:29 丑丑的大灰狼 阅读(907) 评论(0) 推荐(0)
摘要: 1.单表增删改查 from app01.models import * def index(request): return render(request,"index.html") def addbook(request): #第一种添加方式 # b=Book(name="英语基础",price= 阅读全文
posted @ 2020-05-20 15:42 丑丑的大灰狼 阅读(124) 评论(0) 推荐(0)
摘要: filter只能传一个形参,simple_tag可传许多形参,但是控制语句中只能使用filter。 1.在应用文件下创建templatetags文件夹,并在该文件夹内创建相应的py文件。内容前三行必须的,如: from django import template from django.utils 阅读全文
posted @ 2020-05-19 15:23 丑丑的大灰狼 阅读(220) 评论(0) 推荐(0)
摘要: 1.创建Django项目,点击creat 2.出现错误: Error creating Django application: Error on python side. Exit code: 1, err: Traceback (most recent call last): File "mana 阅读全文
posted @ 2020-05-05 11:29 丑丑的大灰狼 阅读(2254) 评论(0) 推荐(0)
摘要: 一、Django安装 1.下载Django安装包 https://www.djangoproject.com/download/ 2.将安装包解压至Python安装位置。 3.进入Anaconda Prompt DOS 界面。 4.输入指令cd *** 进入刚刚解压的Django目录 5.输入指令: 阅读全文
posted @ 2020-05-04 21:30 丑丑的大灰狼 阅读(516) 评论(0) 推荐(0)
摘要: 问题:pymysql.err.InternalError: (1130, "Host 'Chen-PC' is not allowed to connect to this MySQL server") 解决方案: 进入自己的MySQL,执行以下代码即可实现远程访问。 use mysql; sele 阅读全文
posted @ 2020-05-04 09:53 丑丑的大灰狼 阅读(173) 评论(0) 推荐(0)