Django | Model  A model is a Python class in Django that is derived from the django.db.models.Model class. A model is used in Django to represent a table in a database. It is used to interact …

Last updated 3 years, 7 months ago | 1508 views

Tags:- Django

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 …

Last updated 3 years, 7 months ago | 1507 views

Tags:- Python

Windows | Set path and environment variables in Windows 10 Press the + to access the Power User Task Menu. Now, select the System option. In the About window, click the Advanced system settings link under Related settings from the right side. In the Advanced tab, click the  button. In …

Last updated 3 years, 5 months ago | 1505 views

Tags:- Windows

Django | Set up environment variables in Django   1. Install Django Environ In your terminal, inside the project directory, type: $ pip install django-environ 2. Import environ in settings.py import environ 3. Initialise environ …

Last updated 3 years, 5 months ago | 1501 views

Tags:- Django

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 …

Last updated 3 years, 7 months ago | 1499 views

Tags:- 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: …

Last updated 3 years, 7 months ago | 1499 views

Tags:- Python

Python | Access Specifiers Python does not make use of access specifiers specifically like private, public, protected, etc. However, it does not derive this from any variables. It has the concept of imitating the behavior of …

Last updated 3 years, 7 months ago | 1499 views

Tags:- 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, …

Last updated 3 years, 7 months ago | 1499 views

Tags:- Python

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 …

Last updated 3 years, 7 months ago | 1497 views

Tags:- Python

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 …

Last updated 3 years, 7 months ago | 1495 views

Tags:- Django

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 …

Last updated 3 years, 5 months ago | 1493 views

Tags:- Python

Interpreted language An Interpreted language executes its statements line by line. Languages such as Python, Javascript, R, PHP, and Ruby is a prime examples of Interpreted languages. Programs written in an interpreted language runs directly from …

Last updated 3 years, 7 months ago | 1493 views

Tags:- PHP Python

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 …

Last updated 3 years, 7 months ago | 1493 views

Tags:- Python

[::-1] is used to inverse the order of a sequence. >>> my_list = [1,2,3,5,6,7,8,9] >>> my_list[::-1] [9, 8, 7, 6, 5, 3, 2, 1]    

Last updated 3 years, 5 months ago | 1492 views

Tags:- Python

Negative indexes mean that you count from the right instead of the left. So, list[-1] refers to the last element, list[-2] is the second-last, and so on.

Last updated 3 years, 7 months ago | 1485 views

Tags:- Python