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
Post a Comment