[Answer]-Troubles with dynamic filtering in generic-display Django

1👍

✅

To show the single instance you should use the DetailView instead of the ListView:

from django.views.generic.detail import DetailView

class UserProfile(DetailView):
    model = Userx

And change the regex group name to pk:

url(r'^userprofile/(?P<pk>\d+)/$', UserProfile.as_view(), name='userprofile')

Leave a comment