Open dannywillems opened 6 months ago
Can you share an example of the template?
Take this as an example: https://stackoverflow.com/questions/45865205/imagefield-django-template, modulo the changes suggested in the answer. Let me know if you want a full example.
I don't know if this can be a good solution but I had the same issue while serving statics locally, so I overrided the url_fetcher
to fix it.
def url_fetcher(self, url):
if "file://" in url:
file_path = url.replace("file://", "", 1)
if file_path:
url = f"{self.request.scheme}://{self.request.get_host()}{file_path}"
return super().url_fetcher(url)
See https://github.com/WhyNotHugo/django-renderpdf/issues/5#issuecomment-1975244093