Django Tastypie Override URL with slug
问题 I have a similar coce: def override_urls(self): return [ url(r"^(?P<resource_name>%s)/(?P<slug>[\w\d_.-]+)/$" % self._meta.resource_name, self.wrap_view('dispatch_detail'), name="api_dispatch_detail"), ] Which produces an URL like: /api/v1/nodes/<slug>/ Everything fine except that self.get_resource_uri(bundle) returns /api/v1/nodes/<id>/ and I cannot compare the current URL with the resource URI effectively. What am I doing wrong? Solution: working code I implemented the proposed solution