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

matlab - How to equate a structure array to structure array -

c# - Operator '==' incompatible with operand types 'Guid' and 'Guid' using DynamicExpression.ParseLambda<T, bool> -