what’s the difference between a project and an app?
Django | Difference between a project and an app The project covers the entire application, while an app is a module or application within the project that deals with one dedicated requirement. So, a project consists …
How is memory managed in Python?
Python | Memory manage Python has a private heap space to hold all objects and data structures. Being programmers, we cannot access it; it is the interpreter that manages it. But with the core API, …
What is a cookie in Django?
Django | Cookie A cookie is a small piece of information that is stored in the client's browser. It is used to store a user’s data in a file permanently (or for a specified time). Cookie …
“in Python, Functions Are First-class Objects.” What Do You Infer from this?
It means that a function can be treated just like an object. You can assign them to variables and pass them as arguments to other functions. You can even return them from another function. You …
What is PEP 8?
PEP stands for Python Enhancement Proposal. A PEP is an official design document that describes new features proposed for Python and documents aspects of Python, like design and style, for the community. PEP 8 exists to …
How can you generate random numbers?
Python | Generate random numbers Python provides a module called random using which we can generate random numbers. e.g: print(random.random()) We have to import a random module and call the random() method as shown …
What do you mean by the csrf_token?
The csrf_token is used for protection against Cross-Site Request Forgeries. This kind of attack takes place when a malicious website consists of a link, some JavaScript, or a form whose aim is to perform some …
Difference between module and package?. addon how do you create package in python?
Python | Module and Package Module: The module is a simple Python file that contains collections of functions and global variables and with having a .py extension file. It is an executable file and to organize all …
What are unit tests in Python?
Python | What are unit tests Unit test is a testing technique to check a single component of code and ensures that it performs as expected. Unit tests are an important part of regression testing to ensure that …
What is the difference between append() and extend() methods?
Python | append() and extend() Function Both append() and extend() methods are methods used to add elements at the end of a list. append(element): append() method adds the given element at the end of the list. …
How do you check for the version of Django installed on your system?
Django | Check Version To check for the version of Django installed on your system, you can open the command prompt and enter the following command: python -m django –version You can also try to import …
What's the use of a session framework?
Django | Session Framework Using the session framework, you can easily store and retrieve arbitrary data based on the pre-site-visitors. It stores data on the server side and takes care of the process of sending and …
What is __init__ in python?
Python | __init__ constructor method __init__ is a constructor method in Python and is automatically called to allocate memory when a new object/instance is created. All classes have a __init__ method associated with them. class Student: …
What is the difference between Python array and Python list?
Difference between Python array and Python list Array Lists it is used to store only homogeneous data. The list is used to store heterogeneous data it occupies less amount of memory as the array stores …
Differentiate between deep and shallow copies.
Python | Deep and Shallow copies Shallow copy does the task of creating new objects and storing references to original elements. This does not undergo recursion to create copies of nested objects. It just copies the …