absolute url django code example
Example 1: get_absolute_url django
def get_absolute_url(self):
from django.core.urlresolvers import reverse
return reverse('', kwargs={'pk': self.pk})
Example 2: get absolute url
from django.urls import reverse
def get_absolute_url(self):
return reverse('your:url', kwargs={'pk': self.pk})