On the how-to for deploying Scalable Django app., there are instructions for the settings, adding.
AWS_S3_CUSTOM_DOMAIN = 'spaces_edge_endpoint_URL'
What is not clear to me, does this URL allow writing to the also? Or do I need to somehow configure separate read and write URLs?
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!
Hi there,
When integrating Django with DigitalOcean Spaces using the CDN, the AWS_S3_CUSTOM_DOMAIN typically refers to the CDN endpoint of the Space for reading (i.e., serving static/media files). The purpose of using the CDN endpoint is to distribute the content globally to reduce latency for users fetching those assets.
For writing (i.e., uploading files to the Space), Django will use a different endpoint which will be the DigitalOcean Space’s endpoint (not the CDN endpoint). This distinction is managed internally by the libraries you use (like django-storages with the S3 backend).
To clarify:
Reading Files (Serving): Your Django app will serve static and media files using the CDN endpoint (e.g., your-space-name.nyc3.cdn.digitaloceanspaces.com). This is where AWS_S3_CUSTOM_DOMAIN comes into play when you want to serve these assets using the CDN.
Writing Files (Uploading): When your Django app needs to upload a file to the Space, it will use the endpoint associated with your Space directly (e.g., nyc3.digitaloceanspaces.com). This is typically managed through the AWS_STORAGE_BUCKET_NAME and AWS_S3_REGION_NAME settings in conjunction with the library.
To answer your concern directly: No, you don’t need to configure separate read and write URLs in your Django settings when using the typical django-storages setup for DigitalOcean Spaces. The AWS_S3_CUSTOM_DOMAIN is primarily for reading (serving) files through the CDN, while writing (uploading) is managed internally by the library.
Best,
Bobby
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.