SyntaxFix
Write A Post
Hire A Developer
Questions
Nice way to handle not found error in Django.
https://docs.djangoproject.com/en/3.1/topics/http/shortcuts/#get-object-or-404
from django.shortcuts import get_object_or_404 def get_data(request): obj = get_object_or_404(Model, pk=1)