Django - How to avoid using "request.META.HTTP_HOST" in a Django template? -


i'm developing website django. correct or should avoid doing in way?

<img src="http://{{ request.meta.http_host }}/media/assets/img/bike.gif"> 

i'm doing because have internationalization in project , translate url patterns.

there other strategies root url?

best regards,

it seems since using http_host user's browser sent, can write as

<img src="/media/assets/img/bike.gif"> 

and same result.


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -