gpt4 book ai didi

django - 在 aws linux 2 实例上使用弹性 beanstalk 运行 django-q

转载 作者:行者123 更新时间:2023-12-05 06:05:02 27 4
gpt4 key购买 nike

我在 aws 上使用 Elastic Beanstalk 来托管我的 web 应用程序,它需要像 django q 这样的任务运行器。我需要在我的实例上运行它并且在执行时遇到困难。我找到了这个脚本 https://gist.github.com/codeSamuraii/0e11ce6d585b3290b15a9ad163b9aa06它可以满足我的需要,但它适用于旧版本的 ec2 实例。到目前为止,我知道我必须在部署后运行 django q,但是是否可以在启动 wsgi 服务器的同时将进程添加到 procfile。

任何能为我指明正确方向的帮助将不胜感激。

最佳答案

您可以在包的根目录创建一个“Procfile”,内容如下:

web: gunicorn --bind 127.0.0.1:8000 --workers=1 --threads=15 mysite.config.wsgi:application
qcluster: python3 manage.py qcluster

显然,将“mysite.config.wsgi”替换为您的 wsgi 路径。

关于django - 在 aws linux 2 实例上使用弹性 beanstalk 运行 django-q,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66110409/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com