[linux]无法启动 rabbitmq-server,出现 timeout 错误

Date Category linux Tags linux

上次安装 rabbitmq 时,有台服务器上 service rabbitmq-server start 总是起不来。 错误日志里出现如下错误:

ERROR: epmd error for host "yourhostname": timeout (xxxxx)

解决办法就是, 修改 /etc/hosts 将本机的 hostname 加进去:

127.0.0.1    yourhostname

参考

more ...

[django]修复 "TypeError: delete() got an unexpected keyword argument 'using'"

调用 delete 方法时,下面的代码会导致出现标题中的错误:

Foo.objects.filter(name='foo').delete(using='writedb')

原因是因为只有单个查询结果对象的 delete 方法拥有 using 参数, 而查询结果集对象的 delete 方法没有 using 关键字参数:

foos = Foo.objects.filter(name='foo')
for foo in foos:
    foos.delete(using='writedb')
more ...