Until version 3.10, Python never had a feature that implemented what the switch statement does in other programming languages.
You Should Be Using Python’s Walrus Operator – Here’s Why
The assignment operator – or walrus operator as we all know it – is a feature that’s been in Python for a while now (since 3.8), yet it’s still somewhat controversial and many people have unfounded hate for it. In this article I will try to convince you that the walrus operator really is a good addition to the language and that if you use it properly,…
An Overview of Python Memory Management
Python memory management plays a major role to make it much popular and adaptable. How so? Python memory manager has been implemented in a way to support many functionalities and to make our life easier.
Prefetch_related and select_related functions in django
In Django, select_related and prefetch_related are designed to stop the deluge of database queries that are caused by accessing related objects.In this article we will see how it reduces number of queries and make program much faster.
Filtering Django REST framework using IN operator or pass list of values
For filtering by list and using IN operator in django-filters, you can do implement custom filter to do that.
How to check a user’s membership in a group in a template
How in Django template check is user belong to group. Example.
How to delete file or folder in Python
There are several ways delete file or folder in Python
How get the full path of the current file’s directory in Python
There are several ways to get the path to the file or directory where the Python file is located.
Loading initial data in Django migrations using fixtures
It’s sometimes useful to pr-populate your database with hard-coded data when you’re first setting up an app. You can provide initial data with fixtures.
How to sort a Python dict by value
How to sort a Python dict by value (== get a representation sorted by value)