# UUID issue with django.conf.urls.url

**URL:** <https://forum.djangoproject.com/t/uuid-issue-with-django-conf-urls-url/6817>\
**Category:** Using Django\
**Created:** [February 28, 2021, 4:18am UTC](https://forum.djangoproject.com/t/uuid-issue-with-django-conf-urls-url/6817 "2021-02-28T04:18:44Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![devspectre](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/devspectre/32/3559_2.png) [@devspectre](https://forum.djangoproject.com/u/devspectre)\
**Post date:** [February 28, 2021, 4:18am UTC](https://forum.djangoproject.com/t/uuid-issue-with-django-conf-urls-url/6817/1 "2021-02-28T04:18:44Z")

</div>

Hi  
I need to create an endpoint that requires uuid as keyword argument.  
With django.urls.path, I could easily do this like path(’/endpoint/\<uuid:uuid\>/’).  
I am curious to know if there’s any equivalent or workaround with django.conf.urls.url.  
Or should I use path in this case for ease?

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [February 28, 2021, 4:55am UTC](https://forum.djangoproject.com/t/uuid-issue-with-django-conf-urls-url/6817/2 "2021-02-28T04:55:55Z")

</div>

[Django.conf.urls.url is deprecated](https://docs.djangoproject.com/en/3.1/ref/urls/#url) - why would you want to use it now?

---

<div class="post-metadata">

**Author:** ![devspectre](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/devspectre/32/3559_2.png) [@devspectre](https://forum.djangoproject.com/u/devspectre)\
**Post date:** [February 28, 2021, 5:02am UTC](https://forum.djangoproject.com/t/uuid-issue-with-django-conf-urls-url/6817/3 "2021-02-28T05:02:16Z")

</div>

Because original project codebase was all written with url everywhere, I don’t want to overhaul the entire project to replace deprecated url with path or re\_path.  
And I also don’t want to mix url and path if possible.  
That’s why I am trying to find it out.

---

<div class="post-metadata">

**Author:** ![mblayman](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/mblayman/32/101_2.png) [@mblayman](https://forum.djangoproject.com/u/mblayman)\
**Post date:** [February 28, 2021, 6:05am UTC](https://forum.djangoproject.com/t/uuid-issue-with-django-conf-urls-url/6817/4 "2021-02-28T06:05:40Z")

</div>

The equivalent with `url` would be to match against the regex pattern for a UUID. The regex that the `uuid` path converter is defined at [django/converters.py at 5fcfe5361e5b8c9738b1ee4c1e9a6f293a7dda40 · django/django · GitHub](https://github.com/django/django/blob/5fcfe5361e5b8c9738b1ee4c1e9a6f293a7dda40/django/urls/converters.py#L26).

In my opinion, it would probably be easier to convert to `path` than to try to add the regex to an existing `url`.

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [February 28, 2021, 2:02pm UTC](https://forum.djangoproject.com/t/uuid-issue-with-django-conf-urls-url/6817/5 "2021-02-28T14:02:49Z")

</div>

I agree whole-heartedly with @mblayman here. If you continue with the pattern of only using `url`, you’re creating more work to be done later when you need to replace them all with `path`.  
At a minimum, I would use `path` for all new entries. I would _suggest_ changing `url` to `path` in any individual file that you are making these new entries in. But I do agree there’s probably no immediate value in going through your other urls.py files to make changes if you’re not otherwise working in those areas of the code.
