[Answer]-Django get_absolute_url blank

1👍

Use this:

from django.core.urlresolvers import reverse

def get_absolute_url(self):
    return reverse('catalog_category', kwargs={'category_slug': self.slug})

0👍

Do you ask the user to set the slug when doing data entry or is the slug programmatically created from the name field?

The help text suggests the later, but I don’t see the code? You need to override the save method:

How to create a unique slug in Django

Leave a comment