Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

render to response django

from django.http import Http404

def my_view(request):
    my_objects = list(MyModel.objects.filter(published=True))
    if not my_objects:
        raise Http404("No MyModel matches the given query.")
Source by docs.djangoproject.com #
 
PREVIOUS NEXT
Tagged: #render #response #django
ADD COMMENT
Topic
Name
1+2 =