Django: rest endpoint not found
I am trying to implement a rest endpoint with Django. My views.py is:
from django.http import JsonResponse
from rest_framework.decorators import api_view
from rest_framework.response import Response
from rest_framework import status
import json
from .utils import retrieve_and_detect_faces
@api_view(["POST"])
def video_analysis(request):
data = json.loads(request.body)
timestamp = data.get("timestamp")
return JsonResponse({....})
And in urls.py:
from django.urls import path
from .views import video_analysis
urlpatterns = [
path('video_analysis/', video_analysis, name = 'video_analysis')
]
But when I try to call this endpoint, I get error:
Not Found: /video_analysis
[24/Jan/2025 07:37:26] "POST /video_analysis?timestamp=1234567 HTTP/1.1" 404 2262
What configuration am I missing in my program?