Python Interview Questions
1 .
Why is Django loosely packed?
Django has described as a loosely coupled framework because concerning the MTV architecture it’s based upon. Django’s architecture means a variant of MVC architecture and also MTV is helpful because this completely separates the server code of the client’s machine.
2 .
What is the use of
It is an automatically built file inside each Django project. It is a flat wrapper encompassing the It possesses the following usage :
It establishes your project's package on sys.path.
It fixes the DJANGO_SETTING_MODULE environment variable to point to your project's file.
3 .
What is the use of is a command-line argument which is utilised for administrative tasks.
4 .
Explain about Django session?
A session comprises a mechanism to store information on specific server-side at the interaction by the web application. By default, session reserves in the database and allows file-based and cache-based sessions.
5 .
Why do we use a cookie in Django?
A cookie is a piece of information that is stored in a client browser for a specific time. When the specific time is completed cookie gets automatically removed from the client browser.
6 .
Mentions the methods used for setting and getting cookie values?
The two methods to set and get cookie values are
Set_cookie : this method is used to set the values of the cookie
Get_cookie : this method is used to get the values of the cookie
7 .
What is Dogpile effect?
This is defined as an occurrence of event when the cache expires and also when the websites are hit with more number of requests by the client at a time. This dogpile effect can be averted by the use of a semaphore lock. If in the particular system the value expires then, first of all, the particular process receives the lock and begin generating new value.
8 .
When can you use iterators in Django ORM?
Iterators in Python are basically containers that consist of a countable number of elements. Any object that is an iterator implements two methods which are, the __init__() and the __next__()  methods. When you are making use of iterators in Django, the best situation to do it is when you have to process results that will require a large amount of memory space. To do this, you can make use of the iterator() method which basically evaluates a QuerySet and returns the corresponding iterator over the results.