I want to have a absolute/complete url when i call my models get_absolute_url method in template. in my entry model i have below:
def get_absolute_url(self):
return ('blog_entry_detail', (), { 'year': self.pub_date.strftime("%Y"),
'month': self.pub_date.strftime("%b").lower(),
'day': self.pub_date.strftime("%d"),
'slug': self.slug })
get_absolute_url = models.permalink(get_absolute_url)
in my template file:
{{object.get_absolute_url}}
I want to output the url prepended with 'http://www.example.com'
I want to use below lines to get the current domain name but i dont know where will i put it.
from django.contrib.sites.models import Site
current_site = Site.objects.get_current().domain