日常错误集

A

B

C

D

E

  • ERRORS:myApp.Students.scontend: (fields.E120) CharFields must define a ‘max_length’ attribute.

    • CharFields类型必须添加max_length属性
  • Exception: HTTP 599: SSL certificate problem: unable to get local issuer cer

    • 在self.crawl()最后加上validate_cert=False参数

F

  • from django.urls import path ImportError: cannot import name 'path’
    • django2.0以上才支持 from django.urls import path。django1.x是 from django.conf.urls import url

G

H

I

  • ImportError: cannot import name 'DispatcherMiddleware’
    • werkzeug的版本为1.0.0,这个版本中没有DispatcherMiddleware方法 。 卸载werkzeug,重新安装低版本的werkzeug==0.16.0

J

  • json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 1 column 2 (char 1)
    • 问题在json里只能用双引号,不能用单引号!

      json.loads(xxx.replace("'", '"'))

    • 里面有多行多列, 可以逐行读取

      for line in xx.readlines()

K

L

M

N

O

P

Q

R

  • RuntimeError: Queue objects should only be shared between processes through inheritance
    • 进程间通信用:from multiprocessing import Queue
    • 进程池间通信用:from multiprocessing import Manager().Queue

S

  • SyntaxError: Non-UTF-8 code starting with ‘\xe7’ in file
    • 在文件顶部添加

      # -*- coding:utf-8 -*-

T

  • TypeError: not all arguments converted during string formatting
    • 字符占位符前后不匹配

U

  • urllib.error.URLError: <urlopen error [Errno 11001] getaddrinfo failed>

    • 'https://xxx.com'改为"https://xxx.com"
  • urllib.error.URLError:

    • url地址可能不正确

V

  • ValueError: Invalid configuration: - Deprecated option ‘domaincontroller’: use 'http_authenticator
    • 找到错误提示的文件

      File "f:\envs\pachong\lib\site-packages\pyspider\webui\webdav.py", line 216, in <module>

    • 将209行代码

      'domaincontroller: NeedAuthController(app),'

      修改为

      'http_authenticator':{'HTTPAuthenticator':NeedAuthController(app)},

W

X

Y

Z

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

小黄鸭会飞呀

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值