Python | Print String N times >>> s = 'Python' >>> n = 5 >>> print(s * n) PythonPythonPythonPythonPython  

Last updated 4 years, 2 months ago | 1679 views

Tags:- Python Django

Git | Undo the most recent local commits Bellow command is used to reset the last local commit. git reset HEAD~        

Last updated 4 years, 2 months ago | 1677 views

Tags:- Git

Python | Return multiple values from functions >>> def A(): return 2, 3, 4 >>> a, b, c = A() >>> print(a, b, c) 2 3 4  

Last updated 4 years, 2 months ago | 1671 views

Tags:- Python Django

Once you’ve inserted data into your Microsoft SQL Server (MSSQL) database, the next step is retrieving it. Python, combined with the pyodbc library, makes it easy to execute SQL SELECT queries and fetch results for …

Last updated 1 year, 5 months ago | 1656 views

Tags:- Python MSSQL

Python | filter(), map(), and reduce() Functions filter()  function accepts two arguments, a function and an iterable, where each element of the iterable is filtered through the function to test if the item is accepted or …

Last updated 4 years, 4 months ago | 1609 views

Tags:- Python

In Django, static files are the files that serve the purpose of additional purposes such as images, CSS, or JavaScript files. Static files managed by “django.contrib.staticfiles”. There are three main things to  set up static …

Last updated 4 years, 2 months ago | 1598 views

Tags:- Django

 Python | In-place swapping of two numbers >>> a, b = 10, 20 >>> print(a, b) 10 20 >>> a, b = b, a >>> print(a, b) 20 10  

Last updated 4 years, 2 months ago | 1597 views

Tags:- Python Django

Python | vars(), dir() and help()  The vars() function returns the __dict__ attribute of an object. The dir() function returns all properties and methods of the specified object, without the values. The help() function is used to display …

Last updated 4 years, 4 months ago | 1595 views

Tags:- Python

No. However, Abstract Base Classes (ABCs) are a feature from the abc module that let us declare what methods subclasses should implement. Python supports this module since version 2.7.

Last updated 4 years, 4 months ago | 1590 views

Tags:- Python

Introduction: Why Token Refreshing Matters JWT (JSON Web Tokens) are commonly used for securing APIs in modern Django applications, especially with frontend frameworks like React, Vue, or mobile apps. However, access tokens expire quickly (usually …

Last updated 1 year, 4 months ago | 1585 views

Tags:- Python Django DRF

Python | Difference between @staticmethod and @classmethod A staticmethod is a method that knows nothing about the class or the instance it was called on. It just gets the arguments that were passed, no implicit first argument. …

Last updated 4 years, 4 months ago | 1571 views

Tags:- Python

Introduction: Why Swagger API Docs Matter in Django Great code deserves great documentation—especially for APIs. When building REST APIs with Django REST Framework (DRF), clear and up-to-date documentation is critical for: Frontend developers and third-party …

Last updated 1 year, 4 months ago | 1547 views

Tags:- Python Django DRF

Django | NoSQL NoSQL basically stands for “not only SQL”. This is considered an alternative to the traditional RDBMS or relational Databases. Officially, Django does not support NoSQL databases. However, there are third-party projects, such as …

Last updated 4 years, 4 months ago | 1509 views

Tags:- Django

When working with time-sensitive data — such as user activity logs, sales records, or system logs — it’s often necessary to retrieve records from the last month or year relative to today’s date. This guide …

Last updated 1 year, 5 months ago | 1505 views

Tags:- MySQL

How to Remove Special Characters from a String in PHP (With Full Examples) Removing special characters from strings is a common requirement in PHP when handling user inputs, sanitizing file names, creating SEO-friendly URLs, or …

Last updated 1 year, 5 months ago | 1495 views

Tags:- PHP