当前位置:网站首页>Replace Django database with MySQL (attributeerror: 'STR' object has no attribute 'decode')
Replace Django database with MySQL (attributeerror: 'STR' object has no attribute 'decode')
2022-07-02 06:02:00 【I'm not big head】
1. install
pip3 install pymsql2. Look for any one __init__ File plus the following code
import pymysql
pymysql.install_as_MySQLdb()
3. settings.py Configuration replacement
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'mysql',
'USER': 'root',
'PASSWORD': 'foobared',
'HOST': '106.14.42.253',
'PORT': 'xxx',
}
}4. If the following error is reported , Just modify the source code (django2.2x Replace above mysql Will report a mistake , normal )
AttributeError: 'str' object has no attribute 'decode'

5. terms of settlement

Then re execute the database synchronization instruction

边栏推荐
- JWT工具类
- servlet的web.xml配置详解(3.0)
- Cookie plugin and localforce offline storage plugin
- 如何使用MITMPROXy
- [leetcode] day92 container with the most water
- Problems encountered in uni app development (continuous update)
- Redis key value database [seckill]
- Unity Shader 学习笔记(3)URP渲染管线带阴影PBR-Shader模板(ASE优化版本)
- 格式校验js
- How to change the IP address of computer mobile phone simulator
猜你喜欢

Sumo tutorial Hello World

Shenji Bailian 3.53-kruskal

我所理解的DRM显示框架

Test case

步骤详解 | 助您轻松提交 Google Play 数据安全表单

让每一位开发者皆可使用机器学习技术

CNN visualization technology -- detailed explanation of cam & grad cam and concise implementation of pytorch

File contains vulnerabilities (II)

Mathematical statistics and machine learning

从设计交付到开发,轻松畅快高效率!
随机推荐
Eco express micro engine system has supported one click deployment to cloud hosting
Stc8h8k series assembly and C51 actual combat - digital display ADC, key serial port reply key number and ADC value
The Hong Kong Stock Exchange learned from US stocks and pushed spac: the follow-up of many PE companies could not hide the embarrassment of the world's worst stock market
Stick to the big screen UI, finereport development diary
Lingyunguang rushes to the scientific innovation board: the annual accounts receivable reaches 800million. Dachen and Xiaomi are shareholders
php按照指定字符,获取字符串中的部分值,并重组剩余字符串为新的数组
php继承(extends)
mock-用mockjs模拟后台返回数据
Summary of MySQL constraints
Unity Shader 学习笔记(3)URP渲染管线带阴影PBR-Shader模板(ASE优化版本)
PHP inner class name is the same as the inner class method name
Lambda expressions and method references
PHP 开发与测试 Webservice(SOAP)-Win
Web page user step-by-step operation guide plug-in driver js
Deep learning classification network -- vggnet
php数组转化为xml
数据回放伴侣Rviz+plotjuggler
Redis key value database [advanced]
Web页面用户分步操作引导插件driver.js
在uni-app中引入uView