-
-
Notifications
You must be signed in to change notification settings - Fork 938
Supply url_fetcher
to weasyprint
to support /media
and /static
files
#9394
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for inventree-web-pui-preview canceled.
|
@LqdBcnAtWork FYI there are already template tags available to the reporting system for displaying uploaded images:
|
@@ -42,6 +44,31 @@ | |||
|
|||
logger = structlog.getLogger('inventree') | |||
|
|||
WE_BASE_URL = 'http://localhost' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An issue here is that the request URL may or may not exactly match the server's internal URL, depending on proxying settings. Adding a hard-coded URL here is not a good idea.
Just a clarifying question, would it be possible to use these somehow with That was the "problem" this code was meant to solve. The notes editor uses relative paths (eg: This pull request makes it so |
@LqdBcnAtWork yeah I definitely appreciate what you are trying to achieve here. Having another read through, this might not be a terrible idea ;)
So, there are still some issues to deal with here:
|
Let us know if you want pointers how the requested changes might be achieved |
@LqdBcnAtWork are you still looking into this? |
My apologies, I am still planning on doing more on this. But I've been pulled aside to other projects for the time being. I'll get back to this eventually. It's becoming a conversation of when, not if, we'll switch to Inventree. |
Pull request with changes from a comment made on #9351.
This allows
weasyprint
to grab files from/media
and/static
locations by redirecting them toopen()
calls with respect toMEDIA_ROOT
andSTATIC_ROOT
settings.Probably could be made better. But at least ensures that the resulting path is always still a child of the parent folder.