博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
UnicodeDecodeError: 'gbk' codec can't decode byte 0xa6 in position 9737: illegal multibyte sequence
阅读量:4287 次
发布时间:2019-05-27

本文共 530 字,大约阅读时间需要 1 分钟。

配置django项目的时候,如果表还没有创建,直接调用

PageView.objects.create(hostname=hostname)插入数据时报错:

UnicodeDecodeError: 'gbk' codec can't decode byte 0xa6 in position 9737: illegal multibyte sequence

解决方式:

调用脚本创建django中的表

F:\GitHub\django_algorithm>python manage.py makemigrations webAPI

Migrations for 'webAPI':
  webAPI\migrations\0001_initial.py
    - Create model PageView

F:\GitHub\django_algorithm>python manage.py migrate webAPI

Operations to perform:
  Apply all migrations: webAPI
Running migrations:
  Applying webAPI.0001_initial... OK

 

再次启动django访问成功

 

转载地址:http://xzagi.baihongyu.com/

你可能感兴趣的文章
ubuntu python subprocess模块执行python脚本
查看>>
python xticks()函数设置X轴方法--刻度、标签
查看>>
HTTP协议原理
查看>>
Python核心模块——urllib模块
查看>>
Python中read()、readline()和readlines()三者间的区别和用法
查看>>
python正则表达式模块re
查看>>
python爬虫总结
查看>>
python网络编程基础--http
查看>>
python 构造http请求对象-Request对象
查看>>
解决Ubuntu16.04更新源时显示“暂时不能解析域名”问题
查看>>
Ubuntu16.04运行清空文件命令时提示权限不够解决方法
查看>>
shell脚本编写笔记
查看>>
rpm、dpkg、yum、apt比较
查看>>
expect详解
查看>>
Ubuntu16.04实现定时免密远程拷贝脚本
查看>>
Ubuntu 16.04安装Docker
查看>>
Docker报错:Temporary failure in name resolution&Proxy Authentication Required
查看>>
mySQL常用操作及基础知识
查看>>
Ubuntu16.04安装python3.6
查看>>
linux安装Anaconda
查看>>