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

arb*_*101 19 python django amazon-web-services amazon-elastic-beanstalk

我有一个Django网站,运行Django 1.8和Python 3.4,并通过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.
Run Code Online (Sandbox Code Playgroud)

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

谢谢!

Vor*_*ung 4

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

如何修复此处讨论的 https://github.com/pyca/cryptography/issues/2473

这似乎是说卸载 python Cryptography 库,然后 pip install 1.1 版本