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 …

Last updated 3 years, 10 months ago | 1596 views

Tags:- PHP Django CodeIgniter

Python program to count the number of capital letters in a file. with open(FILE_NAME) as my_file: count = 0 text = my_file.read() for character in text: if character.isupper(): count += 1 print(count)    

Last updated 3 years, 8 months ago | 1594 views

Tags:- Python

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, 10 months ago | 1589 views

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

Last updated 3 years, 8 months ago | 1585 views

Tags:- Python

Python | Main Function In the world of programming languages, the main is considered as an entry point of execution for a program. But in python, it is known that the interpreter serially interprets the file …

Last updated 3 years, 10 months ago | 1585 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, 8 months ago | 1579 views

Tags:- Windows

Django follows a Model-View -Template (MVT) architecture which is a variant of the MVC architecture.  Model: Logical data structure behind the entire app and signified by a database. A model is used in Django to …

Last updated 3 years, 8 months ago | 1579 views

Tags:- Django

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, 10 months ago | 1579 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, 10 months ago | 1579 views

Tags:- Python

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, 10 months ago | 1577 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, 10 months ago | 1577 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, 10 months ago | 1577 views

Tags:- Django

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, 8 months ago | 1576 views

Tags:- Django

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, 10 months ago | 1574 views

Tags:- PHP 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, 10 months ago | 1572 views

Tags:- Python