摘要: 一、我的做法 设置2个参数,根据操作对象做切换。 DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME': 'lxg', 'USER': 'myname', 'PASSWORD': 'mypass', 'HOST 阅读全文
posted @ 2020-03-27 21:09 花生与酒 阅读(298) 评论(0) 推荐(0) 编辑
摘要: 1.pycharm环境 https://www.django.cn/article/show-16.html 2.django语法以及入门 https://www.django.cn/course/show-18.html 3.中文网,入门文章多 https://www.django.cn/ 阅读全文
posted @ 2020-03-27 16:25 花生与酒 阅读(167) 评论(0) 推荐(0) 编辑
摘要: 问题一 ubuntu下安装mysql ,参考 :https://www.django.cn/article/show-3.html 1. 安装后,没有编辑mysqld.cnf 因为安装时候弹出窗体,让输入root口令。(lxg) 进入mysql方式: xxx@lxg-opt:/etc/mysql$ 阅读全文
posted @ 2020-03-27 15:48 花生与酒 阅读(120) 评论(0) 推荐(0) 编辑
摘要: 一、字典访问 dict = {"age":18,"weight":65} print(dict.get("age"))print(dict.get("height")) # 由于字典dict中没有height这个键,返回的是默认值None。 print(dict.get("height",0)) # 阅读全文
posted @ 2020-03-27 10:07 花生与酒 阅读(968) 评论(0) 推荐(0) 编辑