python - 从 django.utils.encoding 导入 python_2_unicode_compatible ImportError: cannot import name 'python_2_unicode_compatible'
问题描述
当我尝试使该站点以 SSH 运行时。我收到此错误
File "/home/new_env/lib/python3.6/site-packages/rest_framework/authtoken/models.py", line 6, in <module>
from django.utils.encoding import python_2_unicode_compatible
ImportError: cannot import name 'python_2_unicode_compatible'
我最近将 django 版本从 2.1 t0 3.0.7
解决方案
推荐阅读
- javascript - 如何在ejs页面中呈现markdown
- go - 如何使用反射包获取 chan 类型
- apache-spark - Spark 执行器总是退出
- php - 表单提交后,两因素身份验证不返回错误消息
- python - 页脚元素在 Django 模板中不断缩小
- php - 在 PHP 7.4.2 的类中引用静态函数内的静态变量时出错
- wpf - WPF MVVM itemsControl 和 button 命令不起作用?
- r - 在 R 中将字符串变量(例如“815”)重新编码为时间变量(08:15)
- flutter - 收到用户输入后,我的 setState 不刷新。我正在尝试建立一个聊天页面
- php - 为什么我的删除按钮在 PHP 中不起作用?