# app/urls.py
from django.urls import path
from src.views import PingAPI
urlpatterns = [
path('', PingAPI.as_view()),
]
# src/views.py
from rest_framework.views import Response, APIView
import os
class PingAPI(APIView):
def get(self, *args, **kwargs):
return Response({
'ping': 'pong'
})
flask-restful 처럼 class-based view를 사용했다. 참고 link