I am trying to send POST to my database through POSTMAN and I get 404 not Found status. Here is my views and urls.
#views
`class PlantViewSet(ModelViewSet):
queryset = Plant.objects.all()
serializer_class = PlantSerializer
parser_classes = (MultiPartParser, FormParser)
def create(self, request, *args, **kwargs):
text = request.data["text"]
price = request.data["price"]
picture = request.data["picture"]
Plant.objects.create(text=text, price=price, picture=picture)
return Response("Plant created successfully", status=status.HTTP_200_OK)
`
#App.urls
`router = DefaultRouter()
router.register('plants/', views.PlantViewSet)
urlpatterns = [
path('api/', include(router.urls))
]`
#project.urls
`
urlpatterns = [
path('admin/', admin.site.urls),
path('', include('App.urls'))
]
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)`
I tried Google, ChatGPT, Youtube and none of them helped. Please help!
