摘要: 具体可参考:http://www.liujiangblog.com/course/django/153 https://www.cnblogs.com/liuguniang/p/7141837.html https://www.cnblogs.com/liwenzhou/p/8747872.html 阅读全文
posted @ 2018-05-16 18:20 wy0925 阅读(171) 评论(0) 推荐(0)
摘要: 1)获取id大于1的数据 2)取大于1的第一个 3)删除id=1的 4)把所有名字更新为我那个月 阅读全文
posted @ 2018-05-15 11:44 wy0925 阅读(89) 评论(0) 推荐(0)
摘要: 一)Django WEB框架 2) 3)模板语法: 4)模板语法{{}} 参考网址:https://code.ziqiangxuetang.com/django/django-template2.html 可以html文件中传递list,dict和类,字典的取值比如:{{current.name}} 阅读全文
posted @ 2018-05-11 13:29 wy0925 阅读(100) 评论(0) 推荐(0)
摘要: 如果项目中应用太多,都写到顶层的urls.py中,如果个别应用url出问题的话,其他的应用也会受影响,所以我们需要对每个应用下面都写一个urls.py,实现分发 顶层urls.py中写:(属于blog应用的,都单独提取出来,导入include) blog下的urls.py写 阅读全文
posted @ 2018-05-11 12:04 wy0925 阅读(139) 评论(0) 推荐(0)
摘要: 如果Django顶层目录中没有templates的话,就自己新建一个Directory ,这个文件是存放html文件的 1)如果在views里面用render(request,"")引入的时候引入不了,去setting 里面检查TEMPLATES下面 2)静态文件static:里面存放js文件,se 阅读全文
posted @ 2018-05-11 11:22 wy0925 阅读(244) 评论(0) 推荐(0)
摘要: 参考:https://www.cnblogs.com/linkenpark/p/5881586.html 阅读全文
posted @ 2018-05-09 16:51 wy0925 阅读(158) 评论(0) 推荐(0)
摘要: 1)首先进入数据库: mysql -u root -p(root是用户名) 输入密码 2)创建数据库: create database xxxx default character set=utf8; 3)展示所有数据库: show databases; 4)展示所有数据表 show tables; 阅读全文
posted @ 2018-05-08 09:27 wy0925 阅读(996) 评论(0) 推荐(0)
摘要: 参考:https://blog.csdn.net/qq_37176126/article/details/72824106 阅读全文
posted @ 2018-05-08 08:46 wy0925 阅读(174) 评论(0) 推荐(0)
摘要: 1)建完model 之后,运行./manage.py migrate 2)建立管理员:./manage.py createsuperuser 3)输入用户名和命令上提示的信息,在点击网址,输入admin 就能进去了 阅读全文
posted @ 2018-05-07 17:31 wy0925 阅读(154) 评论(0) 推荐(0)
摘要: 参考文当:https://www.cnblogs.com/heenhui2016/p/6802122.html 阅读全文
posted @ 2018-05-04 17:11 wy0925 阅读(127) 评论(0) 推荐(0)