1👍
✅
No, of course the client can’t load a file on the server via its file path. And you definitely shouldn’t write a function that serves arbitrary files via their path; think of the potential security implications (what if someone requests your settings file with your db credentials, for example).
You shouldn’t be sending a file path in the response at all; instead, your JSON needs to include a URL that serves the file.
- Nginx rewrite to https from http on same server_name block when ssl is handled downstream
- Trying to save my Django Model Formset, keep getting ManagementForm error?
- 'WSGIRequest' object has no attribute 'cart' in django-cartridge
Source:stackexchange.com