views:

62

answers:

1

Hi, I have a flash file which is on a separate media server and the relative path is

/flash/as3.swf

I want to pass this to the template so when it gets rendered it gives the absolute path i.e.

http://myweb.site.com/flash/as3.swf

but when I render it the url is always /flash/as3.swf

Any ideas?

+4  A: 

Use the standard MEDIA_URL setting in your django settings:

MEDIA_URL = 'http://myweb.site.com/'

Then in template, use

{{ MEDIA_URL }}flash/as3.swf

MEDIA_URL will be available in your templates if you render them with RequestContext instance

kibitzer