Missing "Meta.model" attribute i can't find the solution

I'm starting to create my rest Api with django restapi, but my problem is that I create my meta class and it shows me this error:

Class SoundSerializer missing "Meta.model" attribute

This is my code:

from rest_framework import serializers

from sounds.models import Sound

class SoundSerializer(serializers.ModelSerializer):

    class Meta:
        Model = Sound
        fields = '__all__'
from django.urls import path 
from sounds.api.views import SoundList



urlpatterns = [
   
    path('list/',SoundList.as_view() , name ='list'),
    #path('<int:pk>',sounds_names, name='name1'),
]

from rest_framework.response import Response
from sounds.api.serializers import SoundSerializer
from sounds.models import Sound
from rest_framework.views import APIView

from rest_framework.decorators import api_view
# Create your views here.


class SoundList(APIView):
    def get(self,request):
        sounds =Sound.objects.all()
        serializer= SoundSerializer(sounds,many=True)
        return Response(serializer.data) 

    def post(self, request):
        serializer=SoundSerializer(data=request.data)
        if serializer.is_valid():
            serializer.save()
            return Response(serializer.data)
        else:
            return Response(serializer.errors)

As stated by @AbdulNiyasPM in the above comment it should be model not Model.

Back to Top