Complete the code to import the decorator needed for per-view caching in Django.
from django.views.decorators.cache import [1]
The cache_page decorator is used to enable per-view caching in Django.
Complete the code to cache the view output for 15 minutes using the decorator.
@cache_page([1]) def my_view(request): return HttpResponse('Hello World')
The argument to cache_page is the cache timeout in seconds. 15 minutes equals 900 seconds.
Fix the error in the decorator usage by completing the code correctly.
@cache_page([1]) def product_list(request): # view code here pass
The timeout must be an integer number of seconds, not a string or minutes.
Fill both blanks to import and apply the cache decorator to a view.
from django.views.decorators.cache import [1] @[2](60) def homepage(request): return HttpResponse('Welcome!')
You must import cache_page and use it as a decorator to cache the view.
Fill all three blanks to cache a view with a 5-minute timeout and import the decorator.
from django.views.decorators.cache import [1] @[2]([3]) def about(request): return HttpResponse('About us')
Import and use cache_page with a 300-second (5-minute) timeout.