elfs: (Default)
[personal profile] elfs

This is probably a “no-duh” to some people, but I had not known this. When you upload something to the CDN, you get a url that looks like this:

http://cdn.mycompany.com/images/someimage.jpg

Which is all fine and good. Django’s MEDIA_URL is usually suffixed with a closing slash, meaning that if you’re in the habit of typing something like %(foo)s/images/someimage in a standard python template, you’re going to end up with:

http://cdn.mycompany.com//images/someimage.jpg

And the CDN throws a wobbly. Most djangoites know to write the template as {{ MEDIA_URL }}images/someimage.jpg apparently. I need to build that habit. Apache is forgiving. Amazon is not.

This entry was automatically cross-posted from Elf's technical journal, ElfSternberg.com

Profile

elfs: (Default)
Elf Sternberg

December 2025

S M T W T F S
 12345 6
78910111213
14151617181920
21222324252627
28293031   

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jan. 4th, 2026 02:44 am
Powered by Dreamwidth Studios