保存模型后Django应用程序504错误

时间:2016-02-22 05:41:57

标签: python django amazon-web-services elastic-beanstalk

我有一个Django网站,使用Python 3.4运行Django 1.8,并通过ElasticBeanstalk在AWS上托管。

最近,我一直在使用Django管理区域和504错误。这个问题很难再现,似乎是随机发生的。

当我保存模型的实例时,有时网站会挂起并返回504错误(并且不会保存)。之后,elasticbeanstalk重新启动服务器,一切正常。

在我的日志中,我收到以下错误。

End of script output before headers: wsgi.py

extern "Python": function Cryptography_rand_bytes() called, but @ffi.def_extern() was not called in the current subinterpreter.  Returning 0.

这两个错误重复多次。任何人都可以帮我弄清楚如何调试它吗?

谢谢!

2 个答案:

答案 0 :(得分:4)

可能是由于这个错误 https://github.com/pyca/cryptography/issues/2299

如何解决这里讨论的问题 https://github.com/pyca/cryptography/issues/2473

这似乎是说卸载python Cryptography库然后pip安装它的1.1版本

答案 1 :(得分:0)

django-ses通过连接模块中的boto的make_request调用速率限制,这个错误出现了。将密码学1.5恢复为1.1修复了我的错误。