Section 1

Preview this deck

Mention what does the Django templates consists of?

Front

Star 0%
Star 0%
Star 0%
Star 0%
Star 0%

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Active users

0

All-time users

0

Favorites

0

Last updated

6 years ago

Date created

Mar 1, 2020

Cards (18)

Section 1

(18 cards)

Mention what does the Django templates consists of?

Front

The template is a simple text file. It can create any text-based format like XML, CSV, HTML, etc. A template contains variables that get replaced with values when the template is evaluated and tags (% tag %) that controls the logic of the template.

Back

Explain what is Django?

Front

Django is a web framework in python to develop a web application in python.

Back

Explain how you can create a project in Django?

Front

To start a project in Django, you use command $ django-admin.py and then use the command Project _init_.py manage.py

Back

Explain the advantages of Django?

Front

Django is a Python's framework which is easy to learn. It is clear and readable. It is versatile. It is fast to write.

Back

Mention what command line can be used to load data into Django?

Front

Django-admin.py loaddata.

Back

Why Django should be used for web-development?

Front

It allows you to divide code modules into logical groups to make it flexible to change To ease the website administration, it provides auto-generated web admin It provides pre-packaged API for common user tasks It gives you template system to define HTML template for your web page to avoid code duplication It enables you to define what URL be for a given function It enables you to separate business logic from the HTML

Back

List out the inheritance styles in Django?

Front

-Abstract base classes: This style is used when you only wants parent's class to hold information that you don't want to type out for each child model -Multi-table Inheritance: This style is used If you are sub-classing an existing model and need each model to have its own database table -Proxy models: You can use this model, If you only want to modify the Python level behavior of the model, without changing the model's fields

Back

What are the disadvantages of Django?

Front

Django' modules are bulky. Components are deployed together. You must know the full system to work with it.

Back

What are the signals in Django?

Front

Signals are pieces of code which contain information about what is happening. A dispatcher is used to sending the signals and listen for those signals.

Back

Mention what does the Django field class types?

Front

The database column type The default HTML widget to avail while rendering a form field The minimal validation requirements used in Django admin and in automatically generated forms

Back

Explain how you can set up the Database in Django?

Front

You can use the command edit mysite/setting.py , it is a normal python module with module level representing Django settings.

Back

Explain the migration in Django and how you can do in SQL?

Front

Migration in Django is to make changes to your models like deleting a model, adding a field, etc. into your database schema. There are several commands you use to interact with migrations.

Back

Explain the use of session framework in Django?

Front

In Django, the session framework enables you to store and retrieve arbitrary data on a per-site-visitor basis. It stores data on the server side and abstracts the receiving and sending of cookies.

Back

Mention what are the features available in Django?

Front

Admin Interface (CRUD) Templating Form handling Internationalization Session, user management, role-based permissions Object-relational mapping (ORM) Testing Framework Fantastic Documentation

Back

xplain what does django-admin.py makemessages command is used for?

Front

This command line executes over the entire source tree of the current directory and abstracts all the strings marked for translation. It makes a message file in the locale directory.

Back

Give an example how you can write a VIEW in Django?

Front

from datatime import datetime from django.shortcuts import render def home (request): return render(request, 'Guru99_home.html', {'right_now': datetime.utcnow()}) Once you have determined the VIEW, you can uncomment this line in urls.py # url ( r '^$' , 'mysite.myapp.views.home' , name 'Guru99'),

Back

Explain how you can setup static files in Django?

Front

Set STATIC_ROOT in settings.py run manage.py collectsatic set up a Static Files entry on the PythonAnywhere web tab

Back

Mention the architecture of Django architecture?

Front

Models: It describes your database schema and your data structure Views: It controls what a user sees, the view retrieves data from appropriate models and execute any calculation made to the data and pass it to the template.(It is like a bridge between the model and the template.) Templates: It determines how the user sees it. It describes how the data received from the views should be changed or formatted for display on the page Controller: The Django framework and URL parsing

Back