I'm trying to write some code that checks if a static file exists while in DEBUG mode, and I can't get it working. Here's what I've tried in the console:
>> from django.conf import settings
>>> settings.DEBUG
True
>>> from django.contrib.staticfiles.storage import staticfiles_storage
>>> staticfiles_storage.exists('img/vi_crumbs_bkg.gif')
False
This fails, despite vi_crumbs_bkg.gif
existing in my app's static directory. If I symlink it to settings.STATIC_ROOT
, it all works as expected.
So, is there any way I can get staticfiles_storage.exists
to work while in DEBUG mode?
(note: while I know I could just run collectstatic to get this properly working, I'd hate to periodically run that to collect all the assets from all my apps while I'm actively developing)
Thanks in advance -