prod服务器上的cron job django - 找不到manage.py.

时间:2013-10-14 11:09:54

标签: python django cron

我正在尝试在服务器中设置一个cron作业,我在cron选项卡中写了这行:

DJANGO_SETTINGS_MODULE=settings_local PYTHONPATH=$HOME/django-locate:$HOME/locate/locate python manage.py testcommand

但我收到var/mail/myname错误,说找不到manage.py.

我在这里做错了什么?

这是我的cronjob:

class Command(BaseCommand):
args = "<test cron job>"
help = "writes locations from other server" 
def handle(self,*args,**options):
    self.stdout.write("cron job is running - it is just a test ")

1 个答案:

答案 0 :(得分:2)

manage.py不在cron的当前目录中。在运行之前更改当前目录,或提供脚本的完整路径。