问题
findstatic
has a strange behaviour :
- On localhost
python manage.py findstatic pic/xxx.jpg -v 3
gives me :
Found 'pic/xxx.jpg' here:
/[...]/myapp/app1/static/pix/xxx.jpg
Looking in the following locations:
/[...]/myapp/app1/static
/[...]/myapp/app2/static
/[...]/myapp/app3/static
/[...]/env/lib/python3.6/site-packages/django/contrib/admin/static
- whereas on production
it gives me
Found 'pic/xxx.jpg' here:
/[...]/myapp/app1/static/pic/xxx.jpg
Looking in the following locations:
/[...]/myapp/app1/static
/[...]/myapp/app2/static
/[...]/env/lib/python3.6/site-packages/django/contrib/admin/static
(note that the 'app3' directory isn't looked into, despite it exists)
Of course, the files located in the 'app3' directory are not found by findstatic, although they exist.
Does someone have any idea where the problem could come from ? (I don't have any special parameter for staticfiles).
来源:https://stackoverflow.com/questions/41969323/django-findstatic-not-looking-in-every-directory