option
Questions
ayuda
daypo
search.php

SE2019 Django

COMMENTS STATISTICS RECORDS
TAKE THE TEST
Title of test:
SE2019 Django

Description:
SE2019 Django

Creation Date: 2020/08/28

Category: University

Number of questions: 54

Rating:(24)
Share the Test:
Nuevo ComentarioNuevo Comentario
New Comment
NO RECORDS
Content:

What happens when url.py file is edited while the development server is still running?. Development server terminates. The development server automatically restarts. The development server does nothing. The web page is automatically reloaded.

Which setting contains the parameter of main-urls file?. ROOT_URLCONF. MAIN_URLCONF. STATIC_URL. MEDIA_URL.

Django is based on which framework?. MVC. MVVM. MVT or MTV (Model-View-Template). None of the above.

What is the purpose of __init__.py in project directories?. It allows Python to recognise the folder as package. It is useless and can be deleted. It is used to initialise any empty values. None of the above.

Which method is used instead of path() in urls.py to pass in regular expressions as routes?. static(). re_path(). include(). url().

6 What happens if, from the given list, I searched for urlpatterns registration/ skipping the trailing/slash?. Django will give a 404-error page. Django will match registration/ pattern..

What is the use of os.path.dirname(__file__) in this method?. It is the default value and points to Django settings.py. It is passing some value defined before. It is used to pass the value of current file in which this line is written. None of the above.

What does happen when you execute this command in Terminal/ PowerShell? python manage.py shell. It will open interactive interpreter in command line with settings.py file imported.. It will run manage.py in command line.

What is the value of DEBUG when website is online/ or deployed?. False. True. None. Null.

10 What does {{ name }} this mean in Django Templates?. It will be displayed as name in HTML. The name will be replaced with values of Python variable. {{ name }} will be the output. None of the above.

What is this setting for?. This setting is used for Database Caching. This setting is used for Caching. It will store Cache in table dataflair_cache. All of the above.

What will this template generate. Error-invalid syntax. An iterator in list. Logic does not run. None of the above.

What does {{ forloop.counter }} prints. It will not print if for loop variable is not defined. It will count the number of times loop ran. It prints the integer value of no. of times the loop executed. None of the above.

This template {# #} is used for?. It is comment in template language. It is used for business logic. It will raise an exception. None of the above.

What does {% include %} does?. It will include another template. It will include content from another template having the same templates defined. is the same as {% extend %}. None of the above.

What is a Django App?. An app is a functionality, including models and views, that lives together in a single Python package. Django app is a python package with its own components. Django app is an extended package with base package is Django. All of the above.

What are Migrations in Django?. Migrations are files where Django stores changes to your models. They are files saved in migrations directory. They are created when you run makemigrations command. All of the above.

What is the purpose of __str__() method?. It displays a human-readable form of object. It will display the post_heading when __str__() is called. It will return the name of the post when Post object is printed. None of the above.

What is Post.objects.all() is used for?. It is used to bring all the objects stored in Post table. It is used to create a new Post object m. Post object will bring objects from database with SQL Query: Select *. None of the above.

What is DjangoWeb Framework (Python)?. It is fully featured server-side web framework. written in Python. is an open-source python web framework. All of the above.

What is the command to start Django’s built-in development server?. manage.py runserver. manage.py –startup. manage.py startserver–dev. manage.py –run.

What is the Django command to start a new app named ‘users’ in an existing project?. manage.py –newapp users. manage.py newapp users. manage.py –startapp users. manage.py startapp users.

What are the features available in Djangoweb framework?. Admin Interface (CRUD). Templating. Form handling. All of the above.

What are the advantages of using Django for web development?. It facilitates you to divide code modules into logical groups to make it flexible to change. It provides auto-generated web admin to make website administration easy. It provides pre-packaged API for common user tasks. All of the above.

How is django.db.models.Model used to define data models for a Django project?. By invoking a factory method of Model. By creating a new subclass of Model. passing the model definition as a dictionary parameter. By creating a new instance of Model.

Which of the following tasks can be performed with manage.py?. Perform database migrations. Define new data models. Create new applications. All of the above.

8 What is the name of the command-line tool that Django provides for managing a newly-created project and its applications?. django-admin. manage.py. apachectl. pip.

What is the purpose of settings.py?. To configure settings for the Django project. To configure settings for an app. To set the date and time on the server. To sync the database schema.

Where to store static files in django?. in the folder called templates. in the folder called static. in the folder called css. All of the above.

How to do migrations in django. /manage.pymakemigrations<app name>. /manage.pymigrate <app name>. Both a and b. None of the above.

Which of these commands are used to print the SQL query of the model?. Migrate. Makemigrations. Sqlmigrations. Showmigration.

What does the Django command `manage.py validate` do?. Checks for errors in your views. Checks for errors in your templates. Checks for errors in your controllers. Checks for errors in your models.

How to create a DateTimeFieldnamed created and filled in only on the creation with the current time?. created = models.CreationTimeField(). created models.DateTimeField(default=datetime.datetime.now()). created = models.DateTimeField(auto_now=True). created = models.DateTimeField(auto_now_add=True).

What is the command to start a new Djangoproject called ‘myproject’?. django-admin startproject myproject. django-admin.py –start myproject. django.py startprojectmyproject. django.py –new myproject. django.py new myproject.

In Django how would your etrieve all the ‘User’ records from a given database?. User.objects.all(). User.all_records(). User.object.all(). User.objects.

Assuming you’ve imported the proper Djangomodel file, how do you add a ‘User’ model to the Djangoadmin?. admin.site( self, User ). user.site.register( Admin ). users.site.register( Admin ). admin.site.register( User ).

What does a urls.py file do in Django?. This file contains site deployment data such as server names and ports. It contains a site map of Django-approved URLs. It contains URL matching patterns and their corresponding view methods. You run this file when you get obscure 404 Not Found errors in your server logs.

What task do migrations automate?. Structural changes to project database tables to reflect changes to data models. Deployment of project data to production server. Internationalization of site content to reflect local differences in local date and currency formatting conventions. All of the above.

What will happen on execution of this command : > python manage.py createsuperuse. It will create an admin superuser. It will ask for name and password of the superuser. Both a and b. None of the above.

How do you define a ‘name’ field in a Djangomodel with a maximum length of 255 characters?. name = models.CharField(max_len=255). model.CharField(max_length=255). name = models.CharField(max_length=255). model = CharField(max_length=255).

Assuming you have a Djangomodel named ‘User’, how do you define a foreign key field for this model in another model?. model = new ForeignKey(User). user = models.IntegerKey(User). user = models.ForeignKey(User). models.ForeignKey( self, User ).

What is the purpose of the STATIC_ROOT setting?. Defines the URL prefix where static files will be served from. Defines the location where all static files will be copied by the ‘collectstatic’ management command, to be served by the production webserver. A project’s static assets should be stored here to be served by the development server. Defines the location for serving user uploaded files.

How to make Django timezone-aware?. In settings.py: USE_TZ=True. In settings.py: USE_L10N=True. in views.py, import timezone. in urls.py, import timezone.

The architecture of Django consists of?. Models. Views. Templates. All of these.

What are the caching strategies in Django?. File system caching. In-memory caching. Both A and B. None.

Which method is used to check password string given by user in DJANGO?. Test_password. check_password. detect_password. none of the above.

What is the default PORT used by built in webserver in DJANGO?. 8080. 8000. 888. 800.

Which option with manage.py is used to change port number for in build web server?. runserver. runport. portserver. serverport.

How does Django treats a requested Url string?. Unicode string. ASCII character. Python string. EBCDIC mapped string.

Which parameter indicates the template to use in a view?. Template_key. Template_id. Template_identifier. Template_name.

What need to set in settings.py, to tell Django which HOST to use when connect to the database?. database_host. database_name. database_server. database_user.

Which of the following DB (database) includes its Adaptor if Python 2.5+,is used ?. MYSQL. SQLlite. SQL. POSTGRE SQL.

Which regex symbol refers to the ending of specified pattern?. $. #. ^. &.

How do you check for the version of Django installed on your system?. python -m django --version. .

Report abuse