Search This Blog

Digital : Django - Web Framework_FP HackerRank questions and answers Fresco Play Course ID 56762

Q.1 Identify the incorrect middleware hook.

1. process_view()
2. process_exception()
3. process_template_response()
4.template_view()

Ans: 4.template_view()

Q.2 Sessions are __________.

1. Cookie-based
2. Database-backed
3. Cached
4. All the options
5. File based

Ans: 4. All the options

Q.3 Which is a valid path converter?

1. str
2. str and int
3. uuid
4. slug
5. All the options
6. int 

Ans: 5. All the options

Q.4 Identify the incorrect path argument.   

1.route
2. View
3. Model
4. Name

Ans: 3. Model

Q.5 urlpatterns should be a python list of ______ instances.

1. re_path()
2. path
3. None of the options
4. Both Options

Ans: 4. Both Options

Q.6 Identify the equivalent of the following code.
urlpatterns = [
    path('blog/', include(sitepatterns), {'blog_id': 6}),
]

sitepatterns = [
    path('archive/', views.archive),
    path('about/', views.about),
]
1. urlpatterns = [
    path('blog/', include(sitepatterns)),
]

sitepatterns = [
    path('archive/', views.archive, {'blog_id': 6}),
    path('about/', views.about, {'blog_id': 6}),
]
2. urlpatterns = [
    path('blog/', include(sitepatterns)),
]

sitepatterns = [
    path('archive/', views.archive),
    path('about/', views.about, {'blog_id': 6}),
]
3. urlpatterns = [
    path('blog/', include(sitepatterns)),
]

sitepatterns = [
    path('archive/', views.archive, {'blog_id': 6}),
    path('about/', views.about),
]
4. urlpatterns = [
    path('blog/', include(sitepatterns)),
]

mixpatterns = [
    path('archive/', views.archive, {'blog_id': 6}),
    path('about/', views.about, {'blog_id': 6}),
]
Ans : 1. urlpatterns = [
    path('blog/', include(sitepatterns)),
]

sitepatterns = [
    path('archive/', views.archive, {'blog_id': 6}),
    path('about/', views.about, {'blog_id': 6}),
]


Q.7 By default, Django serializes session using ________.

1. pickle
2. json
3. both options
4. None of the options

Q.8 A custom path converter is a class that includes _______.

1. All the options
2. to_url(self,value) method
3. regex string
4. to_python(self, value) method

Ans: 1. All the options





No comments:

Post a Comment

If you have any doubts, Please let us know.