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

May 2025

S M T W T F S
    123
45678910
111213141516 17
18192021222324
25262728293031

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated May. 27th, 2025 06:36 pm
Powered by Dreamwidth Studios