django-easy-pdf icon indicating copy to clipboard operation
django-easy-pdf copied to clipboard

Use staticfiles finders for fetch_resources

Open steinbro opened this issue 10 years ago • 2 comments

In my app, the existing implementation of fetch_resources only worked if collectstatic had been run. Using Django's staticfiles.finders.find() is more flexible for different staticfiles configurations.

steinbro avatar Apr 28 '14 22:04 steinbro

N.B. staticfiles finders are currently a "private interface," but given that the task here is to resolve static file URLs into absolute paths, this seems like a very appropriate use.

https://docs.djangoproject.com/en/1.6/ref/settings/#staticfiles-finders

steinbro avatar Apr 28 '14 22:04 steinbro

Thanks for pointing this out. This makes a lot of sense in case collected static files are not available on the app server. I still consider if the STATIC_ROOT should be checked before calling finders.find.

nigma avatar May 15 '14 22:05 nigma