AWS2 / djmatrics

0 stars 1 forks source link

Image privacy #6

Closed emieza closed 3 years ago

emieza commented 3 years ago

in order to keep image privacy (they are private docs), they will only be displayed embedded into the HTML or in the API.

So, the Upload model can use a standard ImageField, upload to the standard filesystem, and then access the image file binary data as in this example (remember to access the image file as obj.image.path, and then render the image embedded as here.

This way Django will be able to control which files are available for each user, instead of serving them as static content.

The API will be able to send this image as well in a similar way, streaming in base64

It has only the drawback of not being something able to be cached, and thus will be less efficient (but secure which is a must).

rubenmantecon commented 3 years ago

Closed. See #2