Django更换数据库和迁移数据方案( 二 )


修改文件
lib\site-packages\django\core\serializers\json.pyDeserializer 方法中找到这行代码
stream_or_string = stream_or_string.decode()改成这样
stream_or_string = stream_or_string.decode('UTF-16')再进行导入操作
参考资料

  • https://docs.djangoproject.com/en/4.1/ref/django-admin/
  • https://www.shubhamdipt.com/blog/django-transfer-data-from-sqlite-to-another-database/
  • https://javaatpoint.com/solved-unicodedecodeerror-utf-8-codec-cant-decode-byte-0xff-in-position-0-invalid-start-byte/
  • https://counter2015.com/2020/01/15/django-migration-sqlite-to-postgre/
  • https://stackoverflow.com/questions/64457733/django-dumpdata-fails-on-special-characters
【Django更换数据库和迁移数据方案】

推荐阅读