Django2.0版本以上与pymsql 不匹配问题以及解决方法
Django2.0版本以上与pymsql 不匹配问题以及解决方法
Django 2.0 以上 如果使用pymysql0.93,需要一下两步操作:
# 1 第一次报错信息:
File "D:\virtualenv\wx\lib\site-packages\django\db\backends\mysql\base.py", line 36, in <module>
raise ImproperlyConfigured('mysqlclient 1.3.13 or newer is required; you have %s.' % Database.__version__)
django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3.13 or newer is required; you have 0.9.3.
#1.1 根据提示信息进入源码注销这两行,然后在运行
# if version < (1, 3, 13):
# raise ImproperlyConfigured('mysqlclient 1.3.13 or newer is required; you have %s.' % Database.__version__)
# 2 第二次报错处
File "D:\virtualenv\luffy\lib\site-packages\django\db\backends\mysql\operations.py", line 146, in last_executed_query
query = query.decode(errors='replace')
AttributeError: 'str' object has no attribute 'decode'
# 2.2 在根据提示信息进入源码
# 在query = query.decode(errors='replace')解码这行上面,添加一行编码:
# query = query.encode('utf8')
Django2.0版本以上与pymsql 不匹配问题以及解决方法的更多相关文章
- Django2.0版本 path与Django1.x版本url正则匹配问题
Django1.x版本url正则匹配如下: Django2.0版本正则匹配则要导入re_path模块如下:
- 使用sublime text 2 版本至今我所遇到的问题及解决方法
1.汉化:下载汉化包 .打开程序Preference下的浏览包文件夹.将解压的程序包粘贴进包文件夹2.破解:标题栏上面有带(unregistered)表示还没有注册: 打开HELP→Enter lic ...
- android 6.0 SDK中删除HttpClient的相关类的解决方法
一.出现的情况 在eclipse或 android studio开发, 设置android SDK的编译版本为23时,且使用了httpClient相关类的库项目:如android-async-http ...
- Win10操作系统下Oracle VM VirtualBox6.0加载磁盘提示“发现无效设置”的解决方法(包括“不能桥接网卡”问题的解决方法)
自从电脑换成Win10操作系统后,想借助VMBox处理一些事情,但是遇到了不能桥接网卡的问题,还以为是程序坏了,于是卸载重新安装,但是不行.接着又尝试在虚拟机里重新安装操作系统,还是不行. 然后百度了 ...
- VC6的工程转到VC2010或更高版本出现fatal error C1189编译错误的解决方法
以前也遇到过,当时解决了没写下来,这次正好又遇到了,就顺手写一下吧,别下次又忘记了. 当VC6的工程转到VC2010或更高版本时编译出现如下错误: c:\program files\microsoft ...
- 低版本的 eclipse 不支持 tomcat8.5 的解决方法
目录 低版本的eclipse 不支持 tomcat8.5,但是还想使用的方法 低版本的eclipse 不支持 tomcat8.5,但是还想使用的方法 1. 介绍: 我在使用 mars 版本的 ec ...
- 安装TortoiseGit出现提示“您必须安装带有更新版本Windows Installer服务的Windows Service Pack”-解决方法
我的系统是xp sp3安装TortoiseGit时出现了错误提示“您必须安装带有更新版本Windows Installer服务的Windows Service Pack”. 解决方法,到微软官方下载相 ...
- 升级了git版本后git clone报ssl错误的解决方法
由于升级了git版本,git clone 的时候报了如下的错误 fatal: unable to access 'https://github.com/open-falcon/falcon-plus. ...
- Visual Studio 6.0 在 Windows 10 下崩溃的一种解决方法
Visual Studio 6.0 下载地址: https://winworldpc.com/product/microsoft-visual-stu/60 安装步骤: https://www.cod ...
随机推荐
- Rust中的哈希Map
严谨! fn main() { use std::collections::HashMap; let mut scores = HashMap::new(); scores.insert(String ...
- $attrs/inheritAttrs可以实现组件的跨级传递
$attrs/inheritAttrs可以实现组件的跨级传递 // 问题1 为什么this.$attrs可以得到主 传递过来的值 //$attrs 说明 // ...
- 2019 China Collegiate Programming Contest Qinhuangdao Onsite
传送门 D - Decimal 题意: 询问\(\frac{1}{n}\)是否为有限小数. 思路: 拆质因子,看是不是只包含2和5即可,否则除不尽. Code #include <bits/st ...
- centos 7 服务初始化
更新yum源及必要软件安装 yum groupinstall "Development tools" "Compatibility libraries" yum ...
- pointnet++之classification/train.py
1.数据集加载 if FLAGS.normal: assert(NUM_POINT<=10000) DATA_PATH = os.path.join(ROOT_DIR, 'data/modeln ...
- 【java】[null]的问题
这么写逻辑就有问题,改成下面的
- 快速挖pi币
*:first-child { margin-top: 0 !important; } body > *:last-child { margin-bottom: 0 !important; } ...
- 【转】Java代码编译过程简述
转载:https://blog.csdn.net/fuzhongmin05/article/details/54880257. 代码编译是由Javac编译器来完成,流程如下图1所示: 图1 Javac ...
- 一致性算法Raft
参阅:https://www.cnblogs.com/xybaby/p/10124083.html 可视化:http://thesecretlivesofdata.com/raft/
- [LeetCode] 272. Closest Binary Search Tree Value II 最近的二分搜索树的值之二
Given a non-empty binary search tree and a target value, find k values in the BST that are closest t ...