生产中通过crontab的Django归档

2024-06-16 09:25:09 发布

您现在位置:Python中文网/ 问答频道 /正文

我无法让crontab使用django归档执行站点备份。你知道吗

crontab文件:

0 5 * * * python ~/SBGBook/gbsite/manage.py archive

错误:

 Traceback (most recent call last):
     File "/home/jgates/SBGBook/gbsite/manage.py", line 17, in <module>
       "Couldn't import Django. Are you sure it's installed and "
    ImportError: Couldn't import Django. Are you sure it's installed and available $

如果我在python manage.py archive目录中,gbsite/命令非常有效,但是我猜这里有一些路径问题。这都是在生产服务器上的venv中运行的。你知道吗


Tags: installedanddjangopyimportyoumanageit