Hi again folks,
I’m dealing with deployment of my project at the moment and most of the issues i succesfully managed already.
One question is left: I have a function in my project, where based on an user entry a barcode is generated and consecutively saved to specified
MEDIA_ROOT. Corresponds to an ÌmageField`in the model.
Up to now, I’m curious, how to handle this. because i get the barcode generated (it is in .SVG format) when using the live-Version, but i have to reuse
COLLECTSTATIC command, to make it available afterwards…each time----that is not good
MEDIA_FILES are two different things, and should reside in two different directories. The
collectstatic command has nothing to do with media files.
To make media files available, you need to ensure your webserver is configured to serve the directory where those files are stored (
MEDIA_ROOT), and the urls are generated using the
url attribute of the filefield object and not using the
static tag. (See Model field reference | Django documentation | Django and the examples at Managing files | Django documentation | Django)
Sometimes life can be so easy if you know how . Thank You once again.
Took me 5 minutes and now it works as intended. Thx again