How To Set Up Django collecstatic with crontab ?

Question

I want to automate collectstatic with crontab I tried this add to crontab.cr

yes | python2.7 manage.py collectstatic

but I get error : You have requested to collect static files at the destination location as specified in your settings: /home/mojbutik/webapps/webshop/myproject/static This will overwrite existing files! Are you sure you want to do this? CommandError: Collecting static files cancelled. Can someone tell me how to do it...

blaz1988@gmail.com Dec. 22, 2014, 5:29 p.m. 1 Answer

Answers ( 1 )

  1. Dec. 22, 2014, 5:51 p.m.

    You can use command

    python manage.py collectstatic --noinput

     

    For example this will run collectstatic every 2 hour

    0 */2 * * * python manage.py collectstatic --noinput &

Warning! You are not logged in.
Your answer will be published as Guest user.

Post your Answer

Next question