Django - Web Framework
Django - Web Framework
All
sitepatterns = [
There are many error views by default in Django. Identify the incorrect one.http_forbidden()
Mixins are a form of multiple inheritance where behaviors and attributes of multiple parent classes can
be combined.T
Which shortcut function returns the result of filter() on a given model manager cast to a list, raising
Http404 if the resulting list is empty get_list_or_404()
Which view decorator module can be used to restrict access to views based on the request method?
django.views.decorators.http
Which view decorator module can be used to control server and client-side caching?
django.views.decorators.cache
Identify the incorrect option. when ALLOWED_HOSTS configuration is empty, host is validated against
______.[1::]
With {% load humanize %} and the filter intword is used, the value for 3860000 becomes?3.86 million
Which view decorator module can be used to control content compression on a per-view basis?
django.views.decorators.http
Which setting parameter should be modified to start django server with ip 127.100.10.1?
ALLOWED_HOSTS
Strings that have been marked safe from further escaping at output time are called __________.Safe
Strings
>>> c['car']KeyError
Adding a middleware component to the MIDDLEWARE list in the Django settings, activates the
middleware. T
If you write customized error views, the permission_denied() view should be overridden by which
handler?handler404
Which response object allows decorators or middleware to modify a response after it has been
constructed by the view?TemplateResponse
When you define custom tags and filters using python to make them available to templates, use
__________.{% load %}
When {% extends %} is used for inheriting a template?It should be the first template tag in the template
Which template configuration defines a list of directories where the engine should look for template
source files, in search order?DIRS.
Since the template language doesn’t provide exception handling, any exception raised from a template
filter will be exposed as a server error.T
>>> f = ContactForm()
>>> print(f)
>>> f = forms.CharField()
A ______ is a layer of abstraction to work with multiple forms on the same page.Formset