Django product images work locally but return 404 after deploying to Render (Cloudinary media storage)

Hi everyone,

I’m a beginner Django developer, and I recently finished my first full-stack project called Luna Books, an online book shopping application.

The project is working well overall, but I’m stuck on one deployment issue that I haven’t been able to solve.

Everything works correctly on my local machine, including product image uploads and display. However, after deploying to Render, all of my product images are missing. The rest of the application works as expected, including the PostgreSQL database connection.

Current situation

Local development

  • :white_check_mark: Product images display correctly.
  • :white_check_mark: Image uploads work normally.

Live deployment (Render)

  • :white_check_mark: Website loads correctly.
  • :white_check_mark: Products are loaded from the PostgreSQL database.
  • :cross_mark: Product images don’t display.
  • :cross_mark: Image URLs return 404 Not Found.
For example, one of the image URLs is:

/media/book_images/Ikigai-frond.jpg

The database still contains the image paths, but the image files are not being served in the deployed application.

After deploying the project, I noticed that product images were missing only in the live version. I first checked my Django code, media settings, and deployment configuration, but I couldn’t identify the cause.

As part of my troubleshooting, I then configured Cloudinary for media storage. The images appeared briefly on the live site, but after another deployment they disappeared again.

So far I’ve tried:

  • Checking my media and Cloudinary settings.
  • Adding the required Cloudinary environment variables.
  • Re-uploading the images.
  • Redeploying the application.
  • Verifying that the database still contains the correct image paths.

My project uses:

  • Django 6.0
  • Python 3.13
  • Render
  • PostgreSQL
  • Cloudinary
  • WhiteNoise (for static files)

At this point, I’m not sure whether the issue is related to my Cloudinary configuration, my Django media setup, or something specific to Render.

Has anyone experienced something similar, or is there anything else I should check next?

I’ve attached screenshots from the deployed application showing the missing product images. If any additional information or relevant code would help, I’m happy to share it.

Thanks in advance for any guidance!

Hi Anunanda.

Make sure you follow the instructions for deploying static files: How to deploy static files | Django documentation | Django

If you’ve already done that, as a debugging step try to see what image url the browser is trying to load. Right click on the broken images in the browser and copy image address. Or open up browser dev tools and look for the failing image requests.

See how those urls compare to the images that do work, like your header logo. Compare the full url, including the domain. Make sure those files are on your hosting service and see if the urls differ slightly to what the browser is requesting.

Cheers
James

@smallsaucepan covers what I’d recommend. I would only add that if none of those yield results, check your webserver logs and django’s logs. Do note and depending on the webserver used, there may be a separate error log.