1👍
✅
You need to use staticfiles_storage.path()
to read the file. staticfiles_storage.url()
will return the URL that a user will use to load the static file on your site
STATIC_ROOT
is where all static files will be stored after you run collectstatic
, most of the time this is set to <root of the project>/static/
. This is also where staticfiles_storage.path()
will look for static files.
You will also need to set STATICFILES_DIRS so that your file(s) can be found by collectstatic
. I usually have a folder located at <root of the project>/<project name>/static/
which I add to STATICFILES_DIRS
Source:stackexchange.com