I\'m new to Django and am trying to create the back end code for a music application on my website.
I have created the correct view in my views.py file (in the corre
The new path() syntax in Django 2.0 does not use regular expressions. You want something like:
path('/', views.detail, name='detail'),
If you want to use a regular expression, you can use re_path().
re_path(r'^(?P[0-9])/$', views.detail, name='detail'),
The old url() still works and is now an alias to re_path
, but it is likely to be deprecated in future.
url(r'^(?P[0-9])/$', views.detail, name='detail'),