[英]ModuleNotFoundError: No module named 'fcntl' when I try to deploy my django project on heroku
I try to deploy my django project on heroku, and follow commands below我尝试在 heroku 上部署我的 django 项目,并按照以下命令进行操作
heroku login
git init
git add .
git commit -m "first commit"
heroku create
heroku git:remote -a name
pip install gunicorn
gunicorn application.wsgi
when it comes to the latest command, error occurs: ModuleNotFoundError: No module named 'fcntl'当涉及到最新命令时,出现错误:ModuleNotFoundError: No module named 'fcntl'
How can I solve it?我该如何解决?
Is the underlying operating system Windows?底层操作系统是Windows吗? fcntl is not available on Windows system and Gunicorn does not work on windows fcntl 在 Windows 系统上不可用,Gunicorn 在 Windows 上不工作
Run a WSGI web app (like Django) on Windows uing Waitress使用Waitress在 Windows 上运行 WSGI Web 应用程序(如 Django)
Basically all you have to do is replace the gunicorn call with:基本上,您所要做的就是将 gunicorn 调用替换为:
waitress-serve --listen=*:8000 myapp.wsgi:application
For typical apps this will give you the same result as running gunicorn.对于典型的应用程序,这将为您提供与运行 gunicorn 相同的结果。 :) Good luck! :) 祝你好运!
The fcntl module is not available on Windows. fcntl 模块在 Windows 上不可用。 you should use waitress for http and for https use django-sslserver.您应该为 http 使用女服务员,对于 https 使用 django-sslserver。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.