LoginSignup
5
3

More than 5 years have passed since last update.

pyenv 環境の Django コマンドを cron で動かす

Posted at

ちょっとハマったのでメモ。

/var/www/example 以下に pyenv 環境が適用される状況

cd /var/www/example
pyenv local example

crontab を編集

/etc/crontab
BASE_DIR=/var/www/example

* * * * * user cd $BASE_DIR/myapp && /usr/local/pyenv/shims/python manage.py command

python のパスは which python で調べる

5
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
3