Answers for "get absolute url"

0

get absolute url

from django.urls import reverse

def get_absolute_url(self):
        return reverse('your:url', kwargs={'pk': self.pk})
Posted by: Guest on October-11-2020

Python Answers by Framework

Browse Popular Code Answers by Language