4

I need to know if I can "re-collectstatic files" with django static?, for error I deleted a static directory now, I'm trying collectstatic one more time and nothing happen..

Any idea?

BenMorel
  • 34,448
  • 50
  • 182
  • 322
Asinox
  • 6,747
  • 14
  • 61
  • 89
  • Are you expecting collectstatic to replicate the missing static directory ? (meaning deleting the missing files), or are you trying to retrieve these files in the original directory ? – Pierre de LESPINAY Oct 24 '11 at 09:49
  • Does your static directory exist?? Given the age of this question you've likely already solved it though the collectstatic command will overwrite anything there and import anything missing -- assuming the base STATIC dir exists then everything should work – Alvin Jul 03 '12 at 18:07
  • Another issue can be permissions... worth checking the user you are running manage.py as has permissions for the static folder (which might, for example, be owned by Apache) – bjw Aug 02 '12 at 14:50

2 Answers2

1

I come here to see whether I can re-collectstatic without type 'yes'.

Finally, I find it just have to add --no-input

python manage.py collectstatic --no-input
Waket Zheng
  • 5,065
  • 2
  • 17
  • 30
  • Doesn't work for me. This fails to recollect. And that is probably because the timestamp of the collected file is not greater than that of the target. In short, this does not work, it does not force a recollect. – Bernd Wechner Sep 14 '22 at 10:03
0

This will clear current files in the static directory and then collect static.

 python manage.py collectstatic --clear