When I ran into this problemIf you're using django REST framework, I had access to ayou can use the reverse function from rest_framework.request.Requestreverse object. All I had to do was pass that request intoThis has the same behavior as django.core.urlresolvers.reverse(), except that it uses a request parameter to build a full URL.
from rest_framework.reverse import reverse # returns the full url url = reverse('view_name', args=(obj.pk,), request=request) # returns only the relative url url = reverse('view_name', args=(obj.pk,)) Edited to mention availability only in REST framework