[go: up one dir, main page]

0% found this document useful (0 votes)
21 views1 page

1 Python MCQs Exam

The document consists of a set of multiple-choice questions related to Django, covering topics such as error types, templates, data passing, template tags, forms, database connections, querying, migrations, project creation, models, and views. Each question provides four options to choose from, focusing on fundamental concepts in Django development. The questions aim to assess knowledge and understanding of Django's framework and its components.

Uploaded by

sait_80597
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views1 page

1 Python MCQs Exam

The document consists of a set of multiple-choice questions related to Django, covering topics such as error types, templates, data passing, template tags, forms, database connections, querying, migrations, project creation, models, and views. Each question provides four options to choose from, focusing on fundamental concepts in Django development. The questions aim to assess knowledge and understanding of Django's framework and its components.

Uploaded by

sait_80597
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Question Options Answer

1. What type of error does A) Syntax Error, B) Runtime Error, C) Semantic Error,
this code snippet have? D) No Error
def my_function():
print("Hello");
my_function();
my_function();
my_funtion()
2. What is the purpose of A) To define the HTML structure of web pages., B)
templates in Django? To store database queries., C) To handle user input.,
D) To define URL patterns.
3. How do you pass data A) Using the render() function., B) Using the
from your views to send_data() function., C) Using the include()
templates in Django? template tag., D) Using the pass_data() function.
4. What are template tags A) Special instructions that can be used within
and filters in Django? templates to perform actions or modify data., B)
Components of the Django URL system., C)
Functions used to define models., D) Methods for
creating forms.
5. How do you create A) Using the forms.Form class., B) Using the
forms in Django? create_form() function., C) By manually creating
HTML forms., D) Forms are automatically generated
by Django.
6. How do you connect a A) By configuring the DATABASES setting in
Django application to a settings.py., B) By creating a database connection in
database? each view., C) By using the connect_db() function.,
D) Database connections are automatic in Django.
7. How do you query the A) By using the Django ORM (Object-Relational
database from a Django Mapper)., B) By writing raw SQL queries., C) By
view? using the database_query() function., D) By using
the fetch_data() function.
8. How do you create A) Using the makemigrations and migrate
database migrations in commands., B) By manually modifying the database
Django? schema., C) By using the migrate_db() function., D)
Migrations are automatically generated by Django.
9. How do you create a A) Using the django-admin startproject command.,
new Django project? B) Using the create_project command., C) Using the
new_project function., D) By manually creating the
project files.
10. What is the purpose of A) To define the data models for your application.,
the models.py file in a B) To create the application's views., C) To design
Django app? the user interface., D) To handle user
authentication.
11. What is the purpose of A) To handle HTTP requests and return responses.,
a view in Django? B) To display data to the user., C) To define the
database schema., D) To create user accounts.

You might also like