On Sun, 2008-07-06 at 15:21 +0200, Florian Lindner wrote:
> Hello,
> 
> how can I get an absolute URL including a hostname (e.g. 
> http://www.example.org/dir/doc.html) 
>   in a template. I have an object which get_absolute_url I can use but  
> what is the best way of getting the hostname in the template?

If you've got access to the request object in the template (e.g. because
you're using RequestContext), then request.build_absolute_uri should be
something like what you're looking for.

Regards,
Malcolm



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to