3

I need to convert the following regular expression using url() method to path() method.

url(r'^(?P<pk>[-\w]+)/$')

Thanks and regards.

MD. Khairul Basar
  • 4,976
  • 14
  • 41
  • 59
Saloni Kalra
  • 65
  • 1
  • 7

1 Answers1

3

try one of the patterns

path('<int:pk>/')
# or 
path('<slug:pk>/')
anjaneyulubatta505
  • 10,713
  • 1
  • 52
  • 62