Use named keys in your Django template to refer to URLs of objects where the url name or primary key is not known.