반응형 4041 Django 404에러 메시지 출력 from django.http import Http404from django.shortcuts import renderfrom .models import Question# ...def detail(request, question_id): try: question = Question.objects.get(pk=question_id) except Question.DoesNotExist: raise Http404("Question does not exist") return render(request, 'polls/detail.html', {'question': question})이게 일반적인 404 에러 메시지 출력 코드그리고 아래가 숏컷 코드이다.from django.. 2025. 6. 10. 이전 1 다음 반응형