How to serve media files in production

today, I want a way to serve my media files " images only " which are uploaded by the users.

I used whitenoise for my static files and it is working fine
But i dont know how to do the other part.

That can depend, in part, upon what web server you’re running your application in.

It’s similar to static files in that the template rendering engine figures out the url to generate for the files from the combination of your MEDIA_URL setting along with the url attribute of the FileField being rendered.

It’s then up to your web server process to know how to retrieve that file based on the url.

In our case, since we use nginx as our web server, we have a separate location entry for media files.

Also be aware of the security risks with user uploaded content.

I m using Heruko for now.

That’s a problem that has been discussed here a few times in the past.

See:

For some explanations and ideas.

so now i have decided that i will continue with Heroku and i found that i can use Bucketeer that is built on AWS S3 and can be used directly inside of heroku but now i m not able to configure it , its been 48hrs now tried the tutorials present online.
what do you suggest i should do now ? should i stick with heroku or should i change the platform and go to DigitalOcean ?

Error>

SignatureDoesNotMatch

The request signature we calculated does not match the signature you provided. Check your key and signing method.

AKIAVVKH7VVUARQ5YLQD

GET 1679158279 /bucketeer-1236ab06-229b-4ee8-a174-72a96961c7a6/bucketeer-1236ab06-229b-4ee8-a174-72a96961c7a6/placeimages/bank_ivmeHBK.jpg

My7pDuPmTCwdRk9FnLd7TEdXUYo=

47 45 54 0a 0a 0a 31 36 37 39 31 35 38 32 37 39 0a 2f 62 75 63 6b 65 74 65 65 72 2d 31 32 33 36 61 62 30 36 2d 32 32 39 62 2d 34 65 65 38 2d 61 31 37 34 2d 37 32 61 39 36 39 36 31 63 37 61 36 2f 62 75 63 6b 65 74 65 65 72 2d 31 32 33 36 61 62 30 36 2d 32 32 39 62 2d 34 65 65 38 2d 61 31 37 34 2d 37 32 61 39 36 39 36 31 63 37 61 36 2f 70 6c 61 63 65 69 6d 61 67 65 73 2f 62 61 6e 6b 5f 69 76 6d 65 48 42 4b 2e 6a 70 67

76AFQ6244YKC2FF3

gujy4X4RLHBZVa2dS8wMerqBb8w0vDX4ntMwWHR7nMtZ9GsTI9Bb4JgO0aiaG7bfoOAF4vDzHYI=

I’m sorry, but I don’t have any advice for you with Heroku or AWS S3. I’ve never deployed a web site using either of those products.

That’s a decision that only you can make. What I can say is that I am not aware of any “fully zero-configuration” options. No matter what platform you choose, something needs to be configured, so the question is an issue of your current knowledge and willingness to learn what you need to know to make it work.