You should be using the UUID for the primary key unless there is a significant reason not to. However, what you're really getting at is having a better URL structure without the UUID, which I agree with.
I have ran into this problem and I solve it by making a unique slug. The example I'll use below is for a blog with different post titles. The post slugs should be unique so that there are no URL clashes:
# urls.py
# url pretty straightforward, get the post slug from the url and pass it into the view
urlpatterns = patterns('',
url(r'(?P<post_slug>[\w]+)/$', views.post, name="post"),
)
# views.py
# get the post object based on the slug passed in from the url
def post(request, post_slug):
'''
individual blog page
'''
post = Post.objects.get(Post, slug=post_slug)
return render(request, "template.html", {'post':post})
# models.py
# save the unique slug to be used based on the title
from django.db import models
from django.utils.text import slugify
class Post(models.Model):
'''
Blog Post data which has a unique slug field
'''
title = models.CharField(max_length=50)
slug = models.SlugField(unique=True, blank=True)
def save(self, *args, **kwargs):
# add identifying slug field on save
self.slug = slugify(self.title) # can also make a custom slugify to take out hyphens
super(Post, self).save(*args, **kwargs)
And there you have it, your URL structure would work and not have the UUID in the URL. It looks cleaner, just takes a little bit of magic.