Python Ubuntu bug汇总
2021-06-30 02:03
标签:response ssi issue lin pps view charm 修改文件 default 问题1: Django File "/home/bsodgm/Desktop/Django_projection/mall/apps/users/views.py", line 9, in 解决1: from导入路径出错 AttributeError: Got AttributeError when attempting to get a value for field `password2` on serializer ` UserSerializer`. 解决2: serializer中没有write_only_fields关键字, 需要在字段中加write_only=True SystemCheckError: System check identified some issues: ERRORS: 解决3: 在setting中注册user: AUTH_USER_MODEL = "users.User" TypeError: argument to reversed() must be a sequence 解决4: Django 路由中出现使用需要使用[ ]而不是{ }的情况! 问题5: Django ValueError: Unable to configure filter ‘require_debug_true‘: Cannot resolve ‘django.app_keys.log.RequireDebugTrue‘: No module named ‘django.app_keys‘ 解决5: setting日志中的filter中的路径被快捷修改文件名给修改了 注意bug调试优先查看url是否对上, 未对上, 先看后端url是否对, 如果对检查前端代码 问题6: django django.core.exceptions.ImproperlyConfigured: Cannot import ‘Payment‘. Check that ‘payment.apps.PaymentConfig.name‘ is correct. 解决: apps中的name首字母为小写, 但是被修改为大写了 安装时出现Cannot uninstall ‘httplib2‘. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall. 解决7: sudo pip install --ignore-installed httplib2 问题8: ubuntu pycharm python pycharm中不能安装python脚本, pip安装需要权限, 为知笔记不能使用输入法 解决: 将操作的项目和虚拟环境修改为当前用户: 问题: pycharm中快捷件不能用(自动格式化) 解决: Python Ubuntu bug汇总 标签:response ssi issue lin pps view charm 修改文件 default 原文地址:https://www.cnblogs.com/hpcm/p/9643999.html
from .models import User
File "/home/bsodgm/Desktop/Django_projection/mall/apps/users/models.py", line 6, in
class User(AbstractUser):
File "/home/bsodgm/.virtualenvs/django_py3/lib/python3.5/site-packages/django/db/models/base.py", line 118, in __new__
"INSTALLED_APPS." % (module, name)
RuntimeError: Model class apps.users.models.User doesn‘t declare an explicit app_label and isn‘t in an application in INSTALLED_APPS.
问题2: Django
The serializer field might be named incorrectly and not match any attribute or key on the `User` instance.
Original exception text was: ‘User‘ object has no attribute ‘password2‘.
ERROR basehttp 124 "POST /users/ HTTP/1.1" 500 20189
pydev debugger: process 22712 is connecting
问题3: Django
users.Test.groups: (fields.E304) Reverse accessor for ‘Test.groups‘ clashes with reverse accessor for ‘User.groups‘.
HINT: Add or change a related_name argument to the definition for ‘Test.groups‘ or ‘User.groups‘.
users.Test.user_permissions: (fields.E304) Reverse accessor for ‘Test.user_permissions‘ clashes with reverse accessor for ‘User.user_permissions‘.
HINT: Add or change a related_name argument to the definition for ‘Test.user_permissions‘ or ‘User.user_permissions‘.
users.User.groups: (fields.E304) Reverse accessor for ‘User.groups‘ clashes with reverse accessor for ‘Test.groups‘.
HINT: Add or change a related_name argument to the definition for ‘User.groups‘ or ‘Test.groups‘.
问题4: Django
ERROR basehttp 124 "GET /admin/ HTTP/1.1" 500 114103
Performing system checks...
或者:
ImportError: Could not import ‘app_keys.pagination.StandardResultsSetPagination‘ for API setting ‘DEFAULT_PAGINATION_CLASS‘. ImportError: No module named ‘app_keys‘.
pydev debugger: process 28636 is connecting
问题7: ubuntu python pip
sudo chown hpcm:hpcm 文件名 修改组名和用户名
sudo chowm -R hpcm:hpcm 文件名 递归修改
解决: 与其他软件发生冲突:
1. 系统锁屏
2. 网易云等
问题: Traceback (most recent call last):
File "03-12306.py", line 17, in
f.write(response)
TypeError: expected a string or other character buffer object
没有将二进制数据流解析出来:
data.read()
文章标题:Python Ubuntu bug汇总
文章链接:http://soscw.com/index.php/essay/99631.html