[Answer]-Running django standalone scripts in the crontab destroys any import commands related to django

1👍

Replace:

*/1 * * * * /usr/local/bin/python2.7 \
            ~/webapps/Folder/Project/manage.py UpdateModels \
            >> ~/webapps/Folder/Project/logs/unpack.log 2>&1

by:

*/1 * * * * (cd ~/webapps/Folder/Project/; \
             /usr/local/bin/python2.7 manage.py UpdateModels) \
             >> ~/webapps/Folder/Project/logs/unpack.log 2>&1

With this change manage.py would be able to locate django applications.

Leave a comment