View Url Not displayed in DRF web page

23 views
Skip to first unread message

Mokhtar BEN MESSAOUD

unread,
Jun 6, 2024, 3:47:52 PMJun 6
to Django REST framework
Hello

I defined a view for Test
class UserView(APIView):
    http_method_names = ['get']

    def get(self, request):
        # Your code to handle the GET request goes here
        return Response("This is a GET request")


I added the view in urls.py

urlpatterns = [
    path('', include(router.urls)),
    path('userinfo/', UserView.as_view(), name='userinfo'),
]

I get teh expected response
Capture d’écran 2024-06-06 204155.png
but the API is not displayed in API Root
Capture d’écran 2024-06-06 204523.png
what I missed?

Mokhtar BEN MESSAOUD

unread,
Jun 7, 2024, 2:29:09 PMJun 7
to Django REST framework

APIView can not be displayed by Api Root page
Reply all
Reply to author
Forward
0 new messages