Correct Answer:
PAUSE
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Reverse()
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Django-rest-framework-jwt
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
INSTALLED_APPS; settings.py
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Pickle
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Request.FILES; FileField
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Validator
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
When the data in the form may be sensitive
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Views
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
To modify the initial QuerySet that the Manager returns
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
There's less chance of introducing bugs since SQLite already works out the box
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
ListView
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
A server
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Has_changed()
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Set managed=False inside the model.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
A serializer
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Implicit over explicit
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Models
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Manage.py
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
You should set up a new virtualenv for each Django project
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Python manage.py createsuperuser
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
ModelSerializer
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Serializers
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Migrate
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Rest_framework.permissions.IsAuthenticated
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Validator
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Require_safe()
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
A validators file containing a function called validate_spelling imported at the top of model
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
If your single installation powers more than one site
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
When the data in the form may be sensitive
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
GET; POST
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Import django django.get_version()
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
NegativeIntegerField
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Perform db operations without fetching a model object
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Use squashmigrations to reduce the number
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Number_of_fingers
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Django.conf.global_settings.py
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
All of these answers.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
As_p()
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Switch to using POST instead of GET as the request method.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
QuerySets do not create any database activity until they are evaluated.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Actions
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
No. Django's built-in models.User class has been tried and tested—no point in reinventing the wheel.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Use RequestContext.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
In your urls file, add a pattern that includes the name of your static directory.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
HTML and template syntax
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Abstract
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
URL > view > template
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
An empty string at the server root
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Pip install -r requirements.txt
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Class Rainbow:
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Model
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Make sure that you have created a Django project.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
You don't need to do anything—autoescaping is off by default.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Raise MiddlewareNotUsed in the init function of your middleware.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Clean(); Field
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Python
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Django.middleware.cache.AcceleratedCacheMiddleware
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
a sequential circuit
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
FATAL
Note: This Question is unanswered, help us to find answer for this one
Which of the following statements are true about the ImageField class?
Note: There may be more than one right answer.
Correct Answer:
It inherits all attributes and methods from the FileField class.
It validates that the uploaded object is a valid image.
It's default form widget is a ClearableFileInput.
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
Check all True facts about Django.
Note: There may be more than one right answer.
Correct Answer:
Written in Python
Web Application Framework
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Subclass django.contrib.auth.models.AbstractUser and add the extra fields.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
It takes an HttpRequest as its first argument.
Note: This Question is unanswered, help us to find answer for this one
What is the default max_length value of a SlugField class in Django?
Correct Answer:
50
Note: This Question is unanswered, help us to find answer for this one
Which of the following commands will make changes in the database tables schema?
Correct Answer:
python manage.py migrate
Note: This Question is unanswered, help us to find answer for this one
If an instance of a form is named ‘form’, which attribute of form instance holds all validated form data?
Correct Answer:
form.cleaned_data
Note: This Question is unanswered, help us to find answer for this one
Assume a, b, c, d and e are variables which hold some random integer from 1 to 10. Which of the following is NOT correct in django template?
Correct Answer:
{% if a > b > c %}
Note: This Question is unanswered, help us to find answer for this one
Which template command makes a custom template tag/filter available in template?
Correct Answer:
{% load %}
Note: This Question is unanswered, help us to find answer for this one
Which form method binds the data in the URL and is passed to the view?
Correct Answer:
GET
Note: This Question is unanswered, help us to find answer for this one
Which database is not supported by Django ORM?
Correct Answer:
Mongodb
Note: This Question is unanswered, help us to find answer for this one
Django is written in
Correct Answer:
Python
Note: This Question is unanswered, help us to find answer for this one
What is the correct way to randomly order a queryset?
Correct Answer:
order_by('?')
Note: This Question is unanswered, help us to find answer for this one
What is the correct way to Abstract Model class?
Correct Answer:
Add abstract=True in Meta class
Note: This Question is unanswered, help us to find answer for this one
Which of the following is true for model field names?
Correct Answer:
Both of the above
Note: This Question is unanswered, help us to find answer for this one
Which of the following gets called when a view raises an exception?
Correct Answer:
process_exception()
Note: This Question is unanswered, help us to find answer for this one
Which of the following is not a built-in Django template loader class?
Correct Answer:
file.Loader
Note: This Question is unanswered, help us to find answer for this one
Which is the correct way to start a new app inside a django project? [assume new app is called ‘myapp’]
Correct Answer:
python manage.py startapp myapp
Note: This Question is unanswered, help us to find answer for this one
Which of following statements is true to get a Queryset of all Entries which were published before 2006?
Correct Answer:
Entry.objects.get(pub_date__year__in=2006)
Note: This Question is unanswered, help us to find answer for this one
How would you check if a list my_list is empty or not in template ?
Correct Answer:
Both 1 and 2
Note: This Question is unanswered, help us to find answer for this one
Which types of users are allowed to login to the django administration site?
Correct Answer:
Super users and staff users
Note: This Question is unanswered, help us to find answer for this one
Which query includes a shirt with size 40?
Correct Answer:
Both 2 and 3
Note: This Question is unanswered, help us to find answer for this one
Which of the following are valid built-in signal provided by django? Check all that apply.
Correct Answer:
request_started
m2m_changed
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
What command line can be used to load data into Django?
Correct Answer:
Django-admin.py loaddata
Note: This Question is unanswered, help us to find answer for this one
Which of the following methods are allowed in django Listview? Check all that apply.
Note: There may be more than one right answer.
Correct Answer:
get_context_data
get_queryset
get
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
What is the exception raised for this query Entry.objects.filter(blog_id=4)?
Correct Answer:
TypeError
Note: This Question is unanswered, help us to find answer for this one
What is the exception raised when the object is not found while performing the following query? Poll.objects.get(id=1)
Correct Answer:
ObjectDoesNotExist
Note: This Question is unanswered, help us to find answer for this one
Which of the following is NOT correct about Django Models?
Correct Answer:
The name of the table is automatically derived from some model metadata and can not be overridden.
Note: This Question is unanswered, help us to find answer for this one
Which of the following will not register a model "Test" to Django admin?
Correct Answer:
admin(Test)
Note: This Question is unanswered, help us to find answer for this one
Which of the following are built-in signal provided by Django?
Correct Answer:
All of the above
Note: This Question is unanswered, help us to find answer for this one
Which of the following is a possible usage of middlewares in Django?
Correct Answer:
All of the above
Note: This Question is unanswered, help us to find answer for this one
Which is the correct way to allow empty value in CharField?
Correct Answer:
models.CharField(max_length=10, blank=True, null=True)
Note: This Question is unanswered, help us to find answer for this one
What is TRUE about django-admin.py makemessages command?
Correct Answer:
Pulls out all the strings marked for translation and makes a message file in the locale directory.
Note: This Question is unanswered, help us to find answer for this one
Which of the following statements is true about the QuerySet select_related() method?
Correct Answer:
Returns a QuerySet that will “follow” foreign-key relationships, selecting additional related-object data when it executes its query.
Note: This Question is unanswered, help us to find answer for this one
Which of the following are determined by Django using field class types?
Correct Answer:
The database column type
The default HTML widget to avail while rendering a form field
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
Which of the following url patterns is used to register admin urls?
Correct Answer:
url(r'^admin/', include(admin.site.urls))
Note: This Question is unanswered, help us to find answer for this one
What is true about the management command collectstatic?
Correct Answer:
Takes all of the static files of your project and puts them in the folder specified in STATIC_ROOT so they can be served in production.
Note: This Question is unanswered, help us to find answer for this one
What is the name of the command line tool that Django provides for managing a newly created project and its applications?
Correct Answer:
manage.py
Note: This Question is unanswered, help us to find answer for this one
Which of the following is not true about testing?
Correct Answer:
The command used to run all unit tests is ./manage.py test --all
Note: This Question is unanswered, help us to find answer for this one
Which command runs all test in a django project?
Correct Answer:
python manage.py test
Note: This Question is unanswered, help us to find answer for this one
Which of the following is not True?
Correct Answer:
Django does not support Unicode data everywhere.
Note: This Question is unanswered, help us to find answer for this one
Which of the following is not a layer in Django?
Correct Answer:
None of the above
Note: This Question is unanswered, help us to find answer for this one
Which of the following classes uses an HTTP 304 status code?
Correct Answer:
HttpResponseNotModified
Note: This Question is unanswered, help us to find answer for this one
Which template tag is used to add another template to the current one?
Correct Answer:
include
Note: This Question is unanswered, help us to find answer for this one
How would you iterate through a list called my_list in template ?
Correct Answer:
{% for x in my_list %} {% endfor %}
Note: This Question is unanswered, help us to find answer for this one
Which data structure is used to pass context values from views to template?
Correct Answer:
Dictionary
Note: This Question is unanswered, help us to find answer for this one
Which query gives the count of vehicles that are private?
Correct Answer:
Both 1 and 3
Note: This Question is unanswered, help us to find answer for this one
Which attribute is used to order the objects in django admin?
Correct Answer:
ordering
Note: This Question is unanswered, help us to find answer for this one
Which of the following methods is not used in django ListView?
Correct Answer:
get_object
Note: This Question is unanswered, help us to find answer for this one
Which is the correct way to create a superuser from command line?
Correct Answer:
python manage.py createsuperuser
Note: This Question is unanswered, help us to find answer for this one
Which decorators are used to restrict authentication of users?
Note: There may be more than one right answer.
Correct Answer:
@permission_required
@user_passes_test
@login_required
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
Which of the following is true about generators?
Correct Answer:
Generators must contain a yield statement
Note: This Question is unanswered, help us to find answer for this one
Which of the following is NOT used as a server for django in production?
Correct Answer:
Ansible
Note: This Question is unanswered, help us to find answer for this one
What is the full form of FBV and CBV?
Correct Answer:
Function Based Views & Class Based Views
Note: This Question is unanswered, help us to find answer for this one
Which of the following caching strategies are supported in Django? (check any that apply)
Note: There may be more than one right answer.
Correct Answer:
File sytem caching
In-memory caching
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
Which of the following caching strategies can be implemented in Django?
Correct Answer:
All of the above
Note: This Question is unanswered, help us to find answer for this one
Which of the following is the correct way to specify a translation string?
Correct Answer:
Both of the above
Note: This Question is unanswered, help us to find answer for this one
Which of the following features are supported by Django?
Correct Answer:
All of the above
Note: This Question is unanswered, help us to find answer for this one
What is the exception raised when a duplicate value is used in unique field while inserting a record?
Correct Answer:
IntegrityError
Note: This Question is unanswered, help us to find answer for this one
Which is the correct way to allow empty value in Integer Field?
Correct Answer:
models.IntegerField(blank=True, null=True)
Note: This Question is unanswered, help us to find answer for this one
How can you set up static files in Django?
Correct Answer:
All of the above
Note: This Question is unanswered, help us to find answer for this one
Django is a web __ in Python to develop a web application.
Correct Answer:
Framework
Note: This Question is unanswered, help us to find answer for this one
What does setting SESSION_COOKIE_SECURE = True do?
Correct Answer:
Ensures cookie can be sent on HTTPS connection only
Note: This Question is unanswered, help us to find answer for this one
Which of the following are correct ways to add a message?
Correct Answer:
messages.add_message(request, messages.INFO, 'Hello world.')
messages.info(request, 'Hello world.')
messages.success(request, 'Hello world.')
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
Using a template tag you tried to load a templatetag as in {% load poll_extras %} and it failed, what could be the problem ?
Correct Answer:
The app that contain the template tag is not in INSTALLED_APPS
Note: This Question is unanswered, help us to find answer for this one
Which Django core function can be used to send an email?
Correct Answer:
django.core.mail.send_mail
Note: This Question is unanswered, help us to find answer for this one
What is the correct way to insert csrf token for forms in django template?
Correct Answer:
form action="" method="post">{% csrf_token %}
Note: This Question is unanswered, help us to find answer for this one
What is the exception raised if you are using POST against this function?
from django.views.decorators.http
import require_http_methods
@require_http_methods(["GET", "POST"])
def my_view(request):
pass
Correct Answer:
No exception will be raised
Note: This Question is unanswered, help us to find answer for this one
What is the correct way to specify the fields to use in a Model Form?
Correct Answer:
Either 1 or 2
Note: This Question is unanswered, help us to find answer for this one
Which of the following is NOT used to represent ManyToManyField in django model form? Check all that apply.
Note: There may be more than one right answer.
Correct Answer:
Charfield
ModelChoiceField
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
How is the ManyToManyField represented in Django model form?
Correct Answer:
ModelMultipleChoiceField
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
class Transaction(models.Model): product = models.ForeignKey(Product, related_name='+')
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
False
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
simple_tag
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
getattr(settings, "SETTING_NAME", default_value)
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
django.db.models.fields.files.ImageField
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
./manage.py sql myapp
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Raise ValidationError in MyForm.clean()
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
created = models.DateTimeField(auto_now_add=True)
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
clean_foo
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
User.objects.all().aggregate( Avg( 'widgets' ) )
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
class Meta:
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
django-admin.py startproject myproject
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
In settings.py: USE_TZ=True
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
admin.site.register( User )
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Use the exclude parameter in the Meta class in your form
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
__unicode__
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
name = models.CharField(max_length=255)
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
manage.py runserver 12.34.56.78:8080
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Python
Note: This Question is unanswered, help us to find answer for this one
Django MCQs | Topic-wise