By gijsnijholt
Hello,
I’ve setup a Django app with a Space linked to it.
Most files load properly, but somehow some files images won’t.
For example, if you look here https://zonnegrens-nl-kjmoe.ondigitalocean.app/ (ignore fake warning, the original one is also mine, I’m migrating from a droplet to an app)
You’ll see the file header.jpg gets a 403 Forbidden.
If I open it without the query parameters, it loads. So the file exists but just is forbidden: https://ams3.digitaloceanspaces.com/zonnegrens/static/images/header.jpg
Same goes for https://ams3.digitaloceanspaces.com/zonnegrens/static/images/web-app-icon-192x192.png (also 403 while the site loads)
All the other assets load without problems.
The bucket is public.
I’ve set CORS to the DO-generated domain name.
One thing I noticed is that the header image is loaded from CSS as a background-image and the others are loaded via image tags.
Am I missing something?
Thanks a lot!
Gijs
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Accepted Answer
It has to do with html entity encoding of the URLs. Probably something with the setup of django-storages or boto3.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.