django – problem in my regular expression when I should ask for pk and load the next page shows an error

I am trying to sort my web data by requesting primary keys. But do not go to that details page. I need help.

my urls.py file

from django.conf.urls import url
from django.contrib import admin
from myapp import views

urlpatterns =

The
url (r & # 39; ^ admin / & # 39 ;, admin.site.urls),
url (r & # 39; ^ $ & # 39 ;, views.home, name = & # 39; home & # 39;),
url (r & # 39; ^ album /? $ & # 39 ;, views.music, name = & # 39; music & # 39;),
url (r & # 39; ^ detail / (? P d +) / $ & # 39 ;, views.detail, name = & # 39; detail & # 39;),
url (r & # 39; ^ Database /? $ & # 39 ;, views.Database, name = & # 39; Database & # 39;),

]

my views.py file

Def details (request, album_id):
try:
album = Album.objects.get (pk = album_id)
except album.DoesNotExist:
raise Http404 ("The album does not exist")
return render (request, & # 39; album.html & # 39 ;, {& # 39; album & # 39 ;: album})

Error message:

Page not found (404)
Application method: GET
Request URL: http: // localhost: 8000 / myapp /
Using the URLconf defined in mysite.urls, Django tested these URL patterns, in this order:

^ admin /
^ $ [name='home']
^ album /? $ [name='music']
^ detail / (? P d +) / $ [name='detail']
^ Database /? $ [name='Database']
The current path, myapp /, does not match any of these.

You are seeing this error because you have DEBUG = True in your Django configuration file. Change that to False, and Django will display a standard 404 page.