03 2018 档案

摘要:1、进入阿里云镜像加速页面; https://cr.console.aliyun.com/#/accelerator 2、修改/etc/docker/daemon.json文件配置,没有则新建; 3、重启daemon; 4、重启docker服务; 阅读全文
posted @ 2018-03-30 22:13 ianduin 阅读(16218) 评论(0) 推荐(5)
摘要:1、下载安装脚本(官方说明的是不能使用debian的系统的安装方式安装); 2、安装; 3、因为docker命令默认情况下都是要使用root权限来运行的,在生产环境中为了系统安全,不建议使用root账号来运行docker,执行下面的命令将当前用户加入到docker组; 4、将docker修改为随系统 阅读全文
posted @ 2018-03-30 20:52 ianduin 阅读(3627) 评论(0) 推荐(0)
摘要:sudo apt-get install fcitx fcitx-googlepinyin fcitx-module-cloudpinyin fcitx-sunpinyin 阅读全文
posted @ 2018-03-14 21:05 ianduin 阅读(259) 评论(0) 推荐(0)
摘要:pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.Collecting requests Could not fetch URL https 阅读全文
posted @ 2018-03-14 21:04 ianduin 阅读(8273) 评论(1) 推荐(0)
摘要:class MenuList(admin.ModelAdmin): list_display = ('menuId', 'menuName', 'menuDesc', 'menuType', 'sort_order') def formfield_for_foreignkey(self, db_fi 阅读全文
posted @ 2018-03-13 17:29 ianduin 阅读(1136) 评论(0) 推荐(0)
摘要:问题: 在做接口自动化测试的时候,请求报文是json串,但是根据项目规则必须转换成字符串,然后在开头拼接“data=” 接口中很多入参值需要进行参数化。 解决方案: 1、Python并没有对在字符串中简单替换变量值提供直接的支持。 但是通过使用字符串的 format() 方法来解决这个问题。比如: 阅读全文
posted @ 2018-03-13 14:40 ianduin 阅读(1828) 评论(0) 推荐(0)
摘要:python操作oracle数据库需要使用到cx-oracle库。 安装:pip install cx-oracle python连接oracle数据库分以下步骤: 1、与oracle建立连接; 2、获取游标; 3、执行sql语句; 4、fetch查询结果或commit修改结果; 5、关闭游标; 6 阅读全文
posted @ 2018-03-13 14:39 ianduin 阅读(1488) 评论(0) 推荐(0)
摘要:python操作mysql数据库需要使用到mysqlclient库。 安装:pip install mysqlclient python连接mysql数据库分以下步骤: 1、与mysql建立连接; 2、获取游标; 3、执行sql语句; 4、fetch查询结果或commit修改结果; 5、关闭游标; 阅读全文
posted @ 2018-03-13 14:38 ianduin 阅读(1551) 评论(0) 推荐(0)
摘要:1,登陆root帐号 2,cd /etc/yum.repo.d 3,mv CentOS-Base.repo CentOS-Base.repo.bak4,wget http://mirrors.aliyun.com/repo/Centos-7.repo5,mv Centos-7.repo CentOS 阅读全文
posted @ 2018-03-05 22:47 ianduin 阅读(9431) 评论(0) 推荐(0)
摘要:在connect()方法中传入charset='utf8'参数即可。 阅读全文
posted @ 2018-03-05 17:57 ianduin 阅读(227) 评论(0) 推荐(0)
摘要:python配置文件读取 阅读全文
posted @ 2018-03-05 17:47 ianduin 阅读(5653) 评论(0) 推荐(1)
摘要:使用python查询mysql数据库的时候,默认查询结果没有返回表字段名称,不方便使用。为了方便使用一般会选择将查询结果加上字段名称以字典组的方式返回查询结果。 实现如下: 详细原理参考:https://docs.djangoproject.com/en/2.0/topics/db/sql/#exe 阅读全文
posted @ 2018-03-05 17:36 ianduin 阅读(5593) 评论(0) 推荐(0)
摘要:centos笔记本触控板失效 阅读全文
posted @ 2018-03-04 18:39 ianduin 阅读(420) 评论(0) 推荐(0)