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 …

Last updated 4 years, 3 months ago | 1777 views

Tags:- Django

We can use the python re module to match the string import re def check(txt): # regex pattern pattern = 'ab{4,8}' if re.search(pattern, txt): print('Match found') else: print('Match not found') check("abcbbbb") # Match not found check("aabbbbbc") # …

Last updated 4 years, 1 month ago | 1776 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 4 years, 3 months ago | 1776 views

Tags:- Python

Python | strip() Function | Remove whitespaces from a string  To remove the whitespaces and trailing spaces from the string, Python provides a strip([str]) built-in function. This function returns a copy of the string after removing whitespaces …

Last updated 4 years, 3 months ago | 1776 views

Tags:- Python

Python | split() and join() You can use split() method to split a string based on a delimiter to a list of strings. and join() method is used to join a list of strings based on …

Last updated 4 years, 3 months ago | 1775 views

Tags:- Python

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 4 years, 3 months ago | 1775 views

Tags:- Django

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 4 years, 3 months ago | 1774 views

Tags:- Python

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 …

Last updated 4 years ago | 1773 views

Tags:- Python

Using PDB we debug code in python. Some pdb commands include- <b> — Add breakpoint <c> — Resume execution <s> — Debug step by step <n> — Move to next line <l> — List source code …

Last updated 4 years, 3 months ago | 1773 views

Tags:- Python

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 4 years, 1 month ago | 1771 views

Tags:- Django

Python | Pass Statement The pass statement is used as a placeholder for future code. It represents a null operation in Python. It is generally used for the purpose of filling up empty blocks of …

Last updated 4 years, 3 months ago | 1771 views

Tags:- Python

Python has a rich set of built-in exceptions designed to handle various types of runtime errors. These exceptions help you detect and respond to unexpected events during program execution. In this guide, you'll learn: What …

Last updated 1 year, 3 months ago | 1768 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 4 years, 3 months ago | 1767 views

Tags:- Python

Python | Dogpile effect In case the cache expires, what happens when a client hits a website with multiple requests is what we call the dogpile effect. To avoid this, we can use a semaphore lock. When …

Last updated 4 years, 3 months ago | 1767 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 4 years, 3 months ago | 1767 views

Tags:- Python