Django | Delete records in Django models Delete query performs an SQL delete query on all rows in the queryset and returns the number of objects deleted and a dictionary with the number of deletions …

Last updated 1 month ago | 85 views

Tags:- Django

Git add | add files to git This command adds the working directory changes to the staging area. It allows to include the updates to a particular file in the next commit. Git add doesn't affect …

Last updated 2 months ago | 80 views

Tags:- Git

Git init | Initialize a local Git repository The git init command creates a new Git repository in local. This is usually the first command you will run before working on a new project. git …

Last updated 2 months ago | 78 views

Tags:- Git

Git | git status to check the status of the current branch The git status command displays all the necessary information about the working directory and the staging area. git status It displays information like: …

Last updated 2 months ago | 114 views

Tags:- Git

Git | git checkout to Switch branch Git checkout is mostly used for switching from one branch to another. It is also used to check out files and commits. Switch to a branch This command …

Last updated 2 months ago | 122 views

Tags:- Git

Git | Git branch command to create, list, and delete git branch command is used to create a new branch, list all branches, and delete a branch. Branches allow developers to work on the same project …

Last updated 2 months ago | 109 views

Tags:- Git

Git clone | clone git repository Git clone command creates a local copy of the existing source code from a remote repository. git clone ssh://git@github.com/<username>/<repository-name>.git To clone a project from Github:  Click on the green button …

Last updated 2 months ago | 100 views

Tags:- Git

Django | Insert record in database using create() function create() create(**kwargs) Create function create a new object with the given `kwargs`, saving it to the database and returning the created object. It creates an object …

Last updated 2 months, 1 week ago | 100 views

Tags:- Django

Django | order_by query set, ascending and descending order_by() The order_by function is used to sort the result-set in ascending or descending order. Ascending Order The order_by function sorts the records in ascending order by …

Last updated 2 months, 1 week ago | 107 views

Tags:- Django

Python | Get the first 5 words from a string This can be done by using the `split()` and `join()` methods >>> massage = 'Today is a sunny day but tomorrow it might rain' >>> …

Last updated 2 months, 1 week ago | 87 views

Tags:- Python

Django | Overriding the save method The save method is inherited from models.Model class. It is used to override the save method before storing the data in the database. This is used when there is …

Last updated 3 months, 2 weeks ago | 202 views

Tags:- Django

Python | Insert and Get data from an index in Elasticsearch To do so we need to import the Elasticsearch package and create an instance of that by providing the host and port. >>> from elasticsearch …

Last updated 3 months, 2 weeks ago | 192 views

Tags:- Python Elasticsearch

Python | Program to count the number of words in a string split() and len() method is used to get the number of words in a string. The split() method split a string into a list …

Last updated 3 months, 3 weeks ago | 147 views

Tags:- Python

CSS | Gradient Text There are three different CSS properties required to add a gradient overlay to a text. background-image: <gradient> background-clip: text text-fill-color: transparent background-image: <gradient> <gradient> will replace with any gradient style which …

Last updated 3 months, 3 weeks ago | 135 views

Tags:- CSS

Python | Ternary Operator python uses an if-else conditional statement in a single line to represent the Ternary Operator. [true] if [expression] else [false]   Let's see an example of Ternary Operator a, b = …

Last updated 3 months, 3 weeks ago | 173 views

Tags:- Python