Welcome to the Treehouse Community
Looking to learn something new?
Seems fine after hours of trying
from rest_framework.views import APIView from rest_framework.response import Response from . import models from . import serializers class GameList(APIView): def get(self, request, format=None): games = models.Game.objects.all() serializer = serializers.GameSerializer(games, many=True) return Response(serializer.data)
from django.conf.urls import url from . import views urlpatterns = [ url(r'^games /$', views.GamesList.as_view(), name='game_list'), ]
Ryan S27,275 Points
You have 2 small errors in your url pattern.
- You need to remove the extra space in your regex between 'games' and the slash.
- Your view is incorrect. Should be "GameList" (singular), not "GamesList"