'Reverse a URL for the API.'

def get_api_url(self, action=None, api=None, resource=None, pk=False):

    if pk:
        key = self.pk
    else:
        key = self.app_slug
    return reverse('app-detail', kwargs={'pk': key})
