On Apr 3, 1:10 pm, Enpaksh <enpa...@gmail.com> wrote:
> Yes tht is a posibility too and i have tried tht approach but the  
> issue is tht there are lot of html files in my app and i am trying to  
> avoid writing any explicit url because thn i have to keep track of all  
> the pages tht reference to the media server in tht fasion.
>
> Can't i define my server url in MEDIA_URL and some how have django  
> make a cross domain connection automatically? I mean it should be so  
> hard...
>
> Enpaksh Airon
> Sent from my iPhone

But it isn't hard, or at least it isn't unless you make it hard for
yourself as you seem to be trying to do.

The principle - as you seemed to understand from your first message -
is not to let Django interfere in serving static assets. It's
inefficient and unnecessary. Let lightppd do that, since it's the best
suited to do so.

You certainly can - and should - define your server url in MEDIA_URL.
As orukasaki explained upthread, all that does is give you a variable
you can use in templates to point to your external server. But that's
all you need - you don't need Django to make any connections at all,
just leave that up to the user's browser.

So if MEDIA_URL is "http://myassetserver.com";, make sure you pass that
to the template context explicitly or via the "media" context
processor, and then in your template you just do:
<img src="{{ MEDIA_URL }}/img/myimage.png">
--
DR.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to