24Feb

Amazon’s CDN is picky. Django can make dealing with it annoying.

Posted by Elf Sternberg as Uncategorized

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.

Comment Form

Subscribe to Feed

Categories

Calendar

February 2010
M T W T F S S
« Jan   Mar »
1234567
891011121314
15161718192021
22232425262728