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

March 2026

S M T W T F S
1234567
8910111213 14
15161718192021
22232425262728
293031    

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Mar. 23rd, 2026 08:12 am
Powered by Dreamwidth Studios