gpt4 book ai didi

django - 在后台启动 ./manage.py runworker

转载 作者:太空狗 更新时间:2023-10-29 12:09:00 25 4
gpt4 key购买 nike

我想知道我的选择是什么

 ./manage.py runworker 

在后台。我试过这样做

python ./manage.py runworker 2>>./daphneWorker.log >&2

但这似乎也不起作用。关于如何让它在后台运行的任何建议?

最佳答案

您可以使用 nohup 让它在后台运行。

nohup python manage.py runserver 0.0.0.0:80 &

nohup prevents the command from being aborted automatically when you log out or exit the shell.

为了停止在端口80上运行服务器的进程

netstat -nlp | grep :80

上面的命令给你processId或PID

然后:

kill PID

如果您想记录输出

nohup python manage.py runserver 0.0.0.0:80 > myLog.out &

关于django - 在后台启动 ./manage.py runworker,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55319751/

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