error de expresión regular en DJango tratando de encontrar números de índice en blog.html

Tengo el siguiente error al intentar cargar números de índice específicos (relacionados con publicaciones de blog) usando Django.

El código erróneo está debajo - ¿Alguien puede ayudar a señalar el error?

        path(r'(?P)<pk>\d+)', DetailView.as_view(model = Post,template_name = 'blog/post.html'))

El código completo en ese archivo urls.py para mostrar el contexto está aquí:

from django.urls import path
from django.conf.urls import url, include
from django.views.generic import ListView, DetailView
from blog.models import Post


#it's already going to blog/, so this regular expression is just blank

urlpatterns = [

        path(r'', ListView.as_view(queryset=Post.objects.all().order_by("-date") [:25], 
                                                       template_name="blog/blog.html")),

        path(r'(?P)<pk>\d+)', DetailView.as_view(model = Post,template_name = 'blog/post.html'))

] La URL que estoy tratando de alcanzar es:

http://127.0.0.1:8000/blog/2

y el error en la página es:

Page not found (404)
Request Method: GET
Request URL:    http://127.0.0.1:8000/blog/2
Using the URLconf defined in mysite.urls, Django tried these URL patterns, in this order:
admin/
[name='index']
blog/
blog/ (?P)<pk>\d+)
The current path, blog/2, didn't match any of these.
You're seeing this error because you have DEBUG = True in your Django settings file. Change that to False, and Django will display a standard 404 page.

De manera sucinta, necesito ayuda para encontrar el error en el siguiente fragmento de código (la primera ruta funciona bien, es la SEGUNDA RUTA la que no funciona)

urlpatterns = [

        path(r'', ListView.as_view(queryset=Post.objects.all().order_by("-date") [:25], 
                                                       template_name="blog/blog.html")),

        path(r'(?P)<pk>\d+)', DetailView.as_view(model = Post,template_name = 'blog/post.html'))

]

ACTUALIZAR Cambié el código para eliminar el soporte erróneo a esto:

path(r'(?P<pk>\d+)', DetailView.as_view(model = Post,template_name = 'blog/post.html'))]

Pero todavía no funciona ...

Using the URLconf defined in mysite.urls, Django tried these URL patterns, in this order:
admin/
[name='index']
blog/
blog/ (?P<pk>\d+)
The current path, blog/2, didn't match any of these.

Intentando respuesta sugerida Intenté usar esto, pero el error persiste

urlpatterns = [

        path(r'', ListView.as_view(queryset=Post.objects.all().order_by("-date") [:25], 
                                                       template_name="blog/blog.html")),

                path(r'<int:pk>\d+', DetailView.as_view(model = Post,template_name = 'blog/post.html'))]

y probé esto también:

path(r'(?P<int:pk>\d+', DetailView.as_view(model = Post,template_name = 'blog/post.html'))]

Junto con esto:

path(r'(?P<int:pk>\d+)', DetailView.as_view(model = Post,template_name = 'blog/post.html'))]

Los errores persisten

  Using the URLconf defined in mysite.urls, Django tried these URL patterns, in this order:
admin/
[name='index']
blog/
blog/ (?P<int:pk>\d+)
The current path, blog/2, didn't match any of these.

Respuestas a la pregunta(1)

Su respuesta a la pregunta