django forms getting started

django forms getting started
django forms are allow user to enter the data and send it to the server to use it further. django forms are powerful and generates the html form elements which simplifies developers life easy.

Read more

docker compose for django

docker compose for django
Docker compose is used to deploy multiple services in the containers like Django application, PostgreSQL database and Running Django Migrations to create table in the database.

Read more

golang struct convert unix timestamp to date string

golang struct convert unix timestamp to date string
Let's quickly check how we can convert unix timestamp to date string in a Go language. You may already used the unix timestamp, but let's quickly go through what is a unix timestamp ? the Unix timestamp is a way to track time as a running total of seconds. This count starts at the Unix Epoch on January 1st, 1970 at UTC.

Read more

django model CRUD operations

django model CRUD operations
Let's do CRUD operations on django model. Let's write basic queries like insert, update and delete queries using django ORM.

Read more

running flask app inside docker

running flask app inside docker
Docker is container platform is used by hundreds of develops and system admins to build, share and run applications. Let's get started with docker and running a simple flask application using the docker.

Read more

django create table from model

django create table from model
Django made creating the tables in the database very simple with its built-in ORM. To create table in the database with django is to create a django model with all required fields and then create migrations and apply them. Let's jump-in learn how to create database table with django model.

Read more

django database connectivity

django database connectivity
Django supports various relational databases like SQLite, mySQL, PostgreSQL, Oracle. Django is completely designed for Relational Databases so it does not support non-relational databases like mongoDB directly

Read more

django template using if...elif...else

django template using if...elif...else
We can use if...elif..else conditionals in django template. The only difference between python code and django template code is it's syntax. It's similar to python code.

Read more

Django template for loop

Django template for loop
Django provides a template tag "for" to provide the for loop functionality in django templates. By using the for loop template tag we can iterate over lists, tuples, dict's just like we do in python programs.

Read more

django pass data from view to template

django pass data from view to template
As we know django is a MVC framework. So, we seperate business logic from presentational logic. We write business logic in views and we pass data to templates to present the data.

Read more

renderers in Django Rest Framework

renderers in Django Rest Framework
Renderers are used to serialize the response into a specific media type like JSON, XML, YAML, etc. Django REST Framework provides various built-in renderer classes and it also supports to write a custom renderer. We specify renderers as an iterable type (i.e tuple, list, set, etc.). It means we can use multiple renderers for a single view/viewset.

Read more

parsers in Django Rest Framework

parsers in Django Rest Framework
Parsers in Django REST are used to parse the content of incoming HTTP request. In HTTP request we recieve the data as a string format. Parsers will parse the HTTP contetns in to python data types based on the Content-Type header recieved in the HTTP request. Django REST Framework provides a number of built-in parsers which parses different types of

Read more

mysql basics in ubuntu

mysql basics in ubuntu
MySQL is a opensource database software it helps users to store, organise and retrieve data. To manage the MySQL database we can install MySQL Workbench software. Let's see installation process of MySQL

Read more

routers in Django Rest Framework

routers in Django Rest Framework
Routers are used with ViewSets in django rest framework to auto config the urls. Routers provides a simple, quick and consistent way of wiring ViewSet logic to a set of URLs. Router automatically maps the incoming request to proper viewset action based on the request method type(i.e GET, POST, etc). Let's start using routers. Working with DRF Route

Read more

django send email using mailgun api

django send email using mailgun api
We can send email in django using mailgun api. Mailgun is one of the trusted email service providers. When we send email using the mailgun it can directly deiver it to the recipient. As it is a trusted email service provider our email cannot be spammed. So, our information can be reached to the end user. By using mailgun we can send upto 10,000 ema

Read more

viewsets in Django Rest Framework

viewsets in Django Rest Framework
ViewSets are one of the super cool features of Django REST Framework. ViewSets are just a type of class based view but it do not provide request method handlers like "get()", "post()", "patch()", "delete()", etc. But, it provides actions such as "create()", "list()", "retrieve()", "update()", "partial_update()" and "destroy()". DRF allows us to com

Read more

permissions in Django Rest Framework

permissions in Django Rest Framework
Permissions in Django Rest Framework are used to grant or deny access for different types of users to different parts of the API. Permissions are very useful when serving API resources/end-points with certain restrictions. For example, let's consider you are writing an api endpoint to create an answer to a question just like stackoverflow. It only

Read more

authentication in Django Rest Framework

authentication in Django Rest Framework
In previous articles we have developed an open API i.e any user (Authenticated and Un-authenticated) can access the API resource. If we want to want to know the information who is accessing the API then we have to autheticate the user. Authentication means the process or action of verifying the identity of a user. REST framework provides a number o

Read more

advanced class based views in Django Rest Framework

advanced class based views in Django Rest Framework
Django Rest Framework is super awesome to create an web API very quickly. It provides generic views to implement the common functionality. In the previous section we have discussed about class based views in Django REST. Django REST class based views allows us to create an api endpoint with a single request method type i.e one of "GET", "POST", "PU

Read more

class based views in Django Rest Framework

class based views in Django Rest Framework
Django Rest Framework supports both function and class based views. I personally prefer class based views upon function-based views. Because most of the common functionality was already implemented in the the class based views. so, why to write it again we can simply use it. It's always a better approach to keep our code DRY. In DRF we have a class

Read more

python exception handling

python exception handling
python exception handling is one of the concepts in python programming. Before start working with exceptional handling in python what is an exception ? An exception is an event which occurs while running the program which stops the program to work further. Exception also tells about the problem in the code execution. We can write our own exception.

Read more

python reading and writing files

python reading and writing files
File reading and File writing is widely used concept in python because, As we (i.e humans) are lazy we do not remember all the information so we invented the computers(i.e storage devices) to store the information. where will computers store the information? Computer always stores the information in files. Hence, As we programmers we have to learn

Read more

tmux working with split terminal

tmux working with split terminal
Tmux is a terminal multiplexer for linux systems. Tmux allows multiple terminal sessions can be accessed within a single window. Tmux is used for running more than one program in the same terminal at the same time. We can also use it to detach processes/programs from their controlling terminals. Tmux allows SSH sessions to remain active without bei

Read more

python writing modules and packages

python writing modules and packages
We basically write computer programs to solve the problems. Problem may be simpler or moderate one or a complex. For simple problems we can solve it with 50 to 80 lines of code. If it is the case then we can easily manage the code. But, if code grows in an amount thousands of lines then obiviously it will be very difficult to maintain that code. So

Read more

python staticmethod, classmethod and instancemethod

python staticmethod, classmethod and instancemethod
We have three types of class based methods in python. They are 1.static method, 2.class method and 3.instance method. When we are working with classes we will have to deal with different types of scenarios. Based on the scenario we have to use the one of the method types. Let's get started with these python methods. Python Static Methods In python

Read more

how to add image in select options html

how to add image in select options html
we can add an image in select options in html. but, we cannot directly achieve it with the HTML alone. To display the images in the select drop-down we have to use javascript libraries. We can add an image in select options using "select2" jQuery library. what select2 can provide us ? select2 provides the same functionality as normal html select. s

Read more

django admin custom form usage

django admin custom form usage
Django admin allows us to use custom form. In most of the cases we use default admin provided by django. But, in some cases we may need to use some validations on the model fields or we may want to skip some fields and update these fields while saving it. In this kinds of situations we can solve it by using the custom form in django admin. Let's do

Read more

Python working with inheritance - oop's

Python working with inheritance - oop's
Inheritance in python defined as acquiring the properties from the parent/base class to its child classes. In reality we develop complex applications that provides more utilities to users. In developer perspective each utility involves different modules which work together to provide an utility to the user. Each module involves many functions and c

Read more

how to add custom views to django admin

how to add custom views to django admin
how to add custom views to django admin without actually creating the database table ? Let's talk about it. In django admin to get the url link in the admin we have to register the model but in some cases we just need the a url with some functionality under an applicaiton. We can implement it with a simple trick. To implement it we have to create a

Read more

Python method overloading

Python method overloading
method overloading in python can be defined as writing the method in such a way that method will provide different functionality for different datatype arguments with the same method name. Programming languages like Java and C++ implements the method overloading by defining the two methods with the same name but different parameters. In python we d

Read more

'__enter__' and '__exit__' context managers in python

'__enter__' and '__exit__' context managers in python
__enter__ and __exit__ are built in methods in python. __enter__ and __exit__ methods are also called as context manager special methods in python. You may come up with the question "what is a context manager ?". A context manager is a manager which has the ability to make avail the data withing the context or within a block of code and destroy it

Read more

model serializers in Django Rest Framework

model serializers in Django Rest Framework
Model serializers in django rest framework are very similar to the django model forms. By using the model serializers we can reduce the effort of writing the more code for serializers. Model serializers are the shortcuts that allow us to automatically create a serializer with fields that associated with the resective model. Model serializer class i

Read more

Python object oriented programming

Python object oriented programming
Object oriented programming is one of the programming approaches in solving the problems with progamming. Python supports object oriented programming(OOP) approach. While using OOP's in python we mostly use terms like object, class, method, etc. Some of the principles of Object Oriented Programming class object method inheritance polymorphism data

Read more

working with select_related in django

working with select_related in django
select_related is a queryset method in Django which returns new queryset result for a Django Model. select_related is more helpful in foreign-key relationships. It is useful when we are going to use those foreign-key relationship data later in our code. select_related is a preformance booster, which caches the result for the foreign-key relationshi

Read more

using custom widgets in django

using custom widgets in django
In Django we use built-in forms. After rendering the template with form and form fields we can see the equivalent html is generated from the form fields. How Django is doing that ? Well, to generate HTML from the form fields django uses form Widgets. In some cases we need the some specific HTML format from Django widgets. In such cases we write our

Read more

Allow remote connections to PostgreSQL

Allow remote connections to PostgreSQL
Working with the PostgreSQL in server is fine. But, sometimes we need to access the server or cloud database from our local machine. But, when we try to connect to the PostgresSQL server database from local it will not connect. Because, by the default configuration PostgreSQL only allows host "localhost" or "12.0.0.1". To allow remote connections t

Read more

serializers in Django Rest Framework

serializers in Django Rest Framework
Serializers in django rest framework are similar to django forms. By using django rest framework serializers we can serialize and deserialize the data. We can also validate the incoming data using django rest framework serializers to maintain the integrity of the data. We can divide the django rest framework serializers into two categories. Normal

Read more

how to add swap memory in ubuntu

how to add swap memory in ubuntu
In every computer we have a physical memory(i.e: RAM). When a user starts a program it is loaded from the disk (where the program resides) to the RAM, because RAM is faster than the disk memory. Some processes intially need more memory to startup but after it will not use the complete memory that is allocated to it. When RAM is completely used then

Read more

working with supervisor on ubuntu

working with supervisor on ubuntu
In most of the ubuntu virtual private servers it is often case that we will have to run several small programs continuously. The most traditional way to do it is to write a init script in for the program that we want to run continuously. But it is a time consuming process to manage it. Supervisor is a process manager which manages the long running

Read more

django static files usage

django static files usage
Every website needs to serve the extra files such as images, CSS, JavaScript. The name "static" itself indicates that contents of files do not change. So, in django to work with static files we need to make some configurations in setttings.py file.

Read more

how to use templates in django

how to use templates in django
Django is a webframework so, It needs to maintain the code in such a way that it should be easy to navigate and easy to read and maintain. As we already know the Django framework is a MVC, we do not write the HTML code in the views.py instead we write it in a template. In django web framework we generate dynamic HTTP response. While generating the

Read more

usage of group_by and string_agg in django, postgreSQL

usage of group_by and string_agg in django, postgreSQL
In this article we are going to learn how to optimize the queries in Django applications. Django has a built-in ORM which converts the django query into optimized SQL query. In some cases we need to group the data based on some common django field or a table column. This can also be done without using the group_by and string_agg in django query. In

Read more

getting started with Django Rest Framework

getting started with Django Rest Framework
Before we get started with django rest framework we need to have the basic knowledge of python, django and how to work with RESTful API's. Django Rest Framework was developed by Tom Christe. It is one of the worlds leading API development frameworks. Django REST Framework is a open-source software and it is used by worlds best companies including M

Read more

Introduction to RESTful api's

Introduction to RESTful api's
REST(Representational state transfer) is a one of the architectural(designed with some specific rules and regulations) ways to transfer the data by using the HTTP protocol. In this article we will learn what are the restful api's and why we use it.we'll understand api request format and request methods in REST api's and it's usage. Why we use REST

Read more

how to upload python package to pypi

how to upload python package to pypi
Python is a opensource programming language. It's very easy to learn and use. It is used in many areas like web development, game development, network programming, scientific and numeric computing and more. Python's license is administered by the Python Software Foundation. As it is a opensource so many developers are writing their own packages for

Read more

getting started with django first app

getting started with django first app
Let's get started with our very first django application. I always recommend newbies to use the latest versions of django and python. Python2.X.X has no active support. We generally develop many projects on a single machine with different requirements(python packages). If we install python packages globally some ptojects may not work properly. To a

Read more

Python working with for loop

Python working with for loop
Let's start working with for loop in python. For loop is used when want to execute a block of code repeatedly a fixed number of times. Python also comes with the support of iterating the sequences using the for loop. we can use any number of for loops one inside another. we call it as nested for loops. We can skip the execution of code that is insi

Read more

Python working with if ... elif ... else conditions

Python working with if ... elif ... else conditions
Lets start working with if ... elif .. else conditions in python. "if ... elif .. else" allow us to take decisions. It can be nested. In some cases we may need to execute the code based on conditions. Then we use "if ... elif ... else" conditions in python. For example, if we wan to sort the students based on their grades then we have to use these

Read more

understanding the request-response lifecycle in Django

understanding the request-response lifecycle in Django
Let's start understanding the request-response lifecycle of a Django application. Every web application uses HTTP/HTTPS protocol. In the HTTP/HTTPS protocol client sends a request to the server based on the request data server sends the response back to the client. It's the basic principle of HTTP protocol. While setting up the django application i

Read more

django custom path converters

django custom path converters
In django version 2.0 introduced new way to write url patterns using "path". In django 2.0 regular expression type "url" is removed and added 2 things to work with urls. 1. using "path" and 2. using "re_path". For writing the clean urls django provided the path converters. It helps us to write clean and neat code and improves code readability. defa

Read more

working with xls and xlsx files in python

working with xls and xlsx files in python
Let's start working with xls and xlsx files in python. We can read data from xls or xlsx files using python programming and we can also write to xls or xlsx files using python programming. We do this by using the python package "openpyxl". The package "openpyxl" can be found in Python Package Index. So, we can easily install it with python pip. I r

Read more

django image and file upload using ajax

django image and file upload using ajax
Let's learn about how to work with Django image and file upload using Ajax. In most of the cases I personally use django file or image uploads using ajax. If we use normal upload then browser will reload the page in order to load the requested response and we will not have the files in the file fields due to page refreshed by the browser, again use

Read more

working with vim editor in ubuntu

working with vim editor in ubuntu
Let's start working with vim editor on ubuntu. vim is a light weight and powerful text editor used with the command line. It is very useful for system administrators. when deploying the application on the server normal GUI based text editors will not work. Because, GUI is absent on the deployment servers. We also have nano editor but it' doesn't ha

Read more

Python working with lists

Python working with lists
List is a one of the most used data types in python programming. It is a heterogeneous and ordered set of data structure in python. As it is an ordered data structure so, it obiviously supports indexing. We can access the elements of a list using index. It supports both positive and negative indexing. Positive index starts from 0 and negative index

Read more

Python working with frozenset data type

Python working with frozenset data type
Frozenset is an immutable unordered collection of unique elements. It holds collection of element but it does not guarantee the order of the elements in it. As it is immutable we cannot able to update the data once created. when we need to get a unique elements out of group of the repeated elements then we can simply use built-in function "frozense

Read more

Python working with tuple data type

Python working with tuple data type
Tuple is a sequential data structure in python. It is a immutable data type so, we cannot make any modifications to the tuple once created. Tuple stores the data in a sequencial manner. we can access the data in the tuple with indexs. Form the from index starts from 0, 1,2, 3, etc. Tuple also supports negative indexing. Form the rear the index star

Read more

Python working with strings

Python working with strings
String is a most used data type in python programming. A string is simply a series of characters. Anything inside quotes is considered as a string in Python, we can use either single or double quote. As python is a case sensitive language so string 'an' is considered different from string 'An'. In python string represented by data type "str". Note:

Read more

python polymorphism

python polymorphism
Polymorphism can be defined as declaring a uniform interface that is not aware of the type of the data, leaving implementation details to concrete data types that implement the interface. In general terms we can define it as different objects acts differently for same interface. In python we can implement polymorphism in two ways. polymorphism with

Read more

Python working with classes and objects

In this article we will learn how to work with classes and objects in python. Python classes are mainly used for code reusability and better maintainability. You might have a question that we have a functions why do we need classes ? that's a good question. By using functions we can reuse the functionality In some cases we may need to hold the data

Read more

Python working with while loop

Python working with while loop
Let's start working with while loop in python. While loop is used to execute a block of code until certain condition is met. we can also terminate it before using the python keyword "break" If condition is not met then it will run for infinite number of times and we should avoid it. Unlike for loop it won't run for a fixed number of times. Syntax o

Read more

Python working with dict data type

Python working with dict data type
Lets start working with dict data type in python. Dictionary is collection of unordered set of key, value pairs. We can create an empty dictionary with the empty braces {}. dict data type in python is one of the most used datatypes in python builtin data types. We can only able to use keys which are in immutable nature. i.e. we can use string, tupl

Read more

Python working with set data type

Python working with set data type
Lets start working with set data type in python. Set is a heterogeneous un-ordered set of elements with no repetition. set data structure is also just like frozensets. The only difference between sets and frozensets is sets are immutable where as frozensets are not mmutable in nature. we can use sets to checking of membership and eleminating the re

Read more

Python working with functions

Python working with functions
A function in python defined as a a group of statements that required to perform a task which takes required inputs and returns the output. We have two types of functions 1. built-in functions and 2. user defined functions. We have many built-in functions in python. You can see the list of pyhon built-in functions in in python documentation. Syntax

Read more

introduction to javascript programming

introduction to javascript programming
Javascript is a dynamic client side, interpreted and prototype based programming language. It's also used as a server side programming language in frameworks like nodejs, Apache CouchDB.JS .JavaScript follows the standards of ECMA(European Computer Manufacturers Association). All modern Web browsers support JavaScript with built-in interpreters. Di

Read more

django html to pdf using pdfkit and wkhtmltopdf

django html to pdf using pdfkit and wkhtmltopdf
In many ecommerce django/python projects we sent invoices to the users in an email. We generally attach pdf documents to the email while sending the invoices to the user. Most of these invoices are pdf documents. Django is the most used python web framework of python programming language. In django, to generate invoice we generally uses html templa

Read more

understanding of HTTP protocol

understanding of HTTP protocol
Before talking about HTTP Protocol, let's talk about "Protocol". A protocol is a set rules to be followed to communicate with one another. Let's take two persons say A, B. Person A lives in USA and person B lives in India and he doesn't know english. Person A sent a message to B. Inorder to understand the message, B has to follow english language g

Read more

understanding Model View Controller(MVC) in Django

understanding Model View Controller(MVC) in Django
What is Model View Controller? We call it in short MVC. It's a software architecture pattern that is used to devide the complex software into simple parts based on the functionality. When we use Google for web search, we simply open Google and search for "food" let's say. Then google will show us results about food. This what we see. But, actually

Read more

understanding django project structure

understanding django project structure
In the previous article we have seen how to setup the django development environment. In this article we will learn about how to create django proect and django project structure. We care about project structure because it helps us to organise the complex project code. A well structured project will helps the developers to navigate through the code

Read more

usage of property decorator in python

usage of property decorator in python
In this article we will learn about usage of property decorator in python. "property" is a built-in decorator in python. "property" is mostly used with classes. The decorator "property" makes the method that acts like an attribute to the python class. "property" is a callable object in python. It has three methods "getter", "setter" and "deleter".

Read more

deploy django app with apache server on ubuntu

deploy django app with apache server on ubuntu
In this article we will learn about how to deploy django app on apache server. Apache server is a free and open-source HTTP server that is free to use. It is a cross platform web-server, It support's most of the operating systems like windows, linux, Mac, etc. Apache server is not intended to use to create any website. The main purpose of apache is

Read more

Python working with numbers

Python working with numbers
Python has four basic number types. 1. Integers(int), 2. Floating point numbers(float), 3. Long integers(long), 4. Complex Numbers(complex). All these numeric types are immutable data types, it means changing the value of a numeric data type will results in a newly creation of an object. Integers(int) An integer is a whole number (not a fractional

Read more

Python working with operators

Python working with operators
In this article we will learn about different types of operators & working with operators in python. An operator is a symbol or a character in programming which takes two operands to perform an action. For example, in the expression "4 + 5" , "+" is an operator It will perform sum of numbers "4" and "5" and returns result "9". Types of operators in

Read more

Python working with boolean data type

Python working with boolean data type
Boolean data type is a one of the data types in python programming language. Boolean data has only two values True and False. It is mostly used to check whether the given statement is correct or not. It is the most used data type in any programming languages. Boolean data intended to use for Boolean Algebra . In python we mostly use it conditional

Read more

Python Variables and data types

Python Variables and data types
Let's begin learning variables and data types in python programming. In this article we will learn about how to use variable to store the data. we will also learn about different data types provided by python programming language. In python, without using the variables and data types we can't able write programs that can solve problems. What is a v

Read more

Python Introduction to programming

Python Introduction to programming
Python is a high-level and interpreted programming language. It is created by Guido van Rossum. Python first released in 1991, Python has a good design philosophy. It provides features like code readability, and a syntax that allows fewer lines of code to implement functionality compare to other programming languages. Python is a general purpose pr

Read more

Brief introduction to computers and programming

Brief introduction to computers and programming
Lets talk a little bit about computer. If we do not have computers most of the works will take much time to complete it. Computers reduces the human efforts and speedup the working process. It doesn't make errors while doing a task, but humans do. There are other factors that affect humans to make errors. Lets start with introduction to computers a

Read more

setting up django development environment

setting up django development environment
Django Web Framework is becoming very popular because of its easyness to use and support for rapid development with good security and reliability. Django developers has a good demand in the industry. Before we are diving into django we need to install "python 3.x.x" in our OS(operating systems). Django is no longer providing the support for python

Read more

Introduction to django web framework

Introduction to django web framework
Django is a high level python web framework. It is a open source web framework released under the licence of BSD. Django allows developers to build web applications in a short span of time. Django applications are powerful, fast, most secure and exceedingly scalable. Django was designed to help developers to complete the web applications as quickly

Read more

using custom user model in django

using custom user model in django
When we start a new project we have to use custom user model in django application. Because, django provides basic fields required for the user. We may require to add extra fields in the future. So, we have to use custom user model. To implement the custom user model in django application we do not need to rewrite the model from the scratch. We ca

Read more

why tuple is faster than list in python ?

why tuple is faster than list in python ?
In python we have two types of objects. 1. Mutable, 2. Immutable. In python lists comes under mutable objects and tuples comes under immutable objects. Tuples are stored in a single block of memory. Tuples are immutalbe so, It doesn't require extraspace to store new objects. Lists are allocated in two blocks: the fixed one with all the Python objec

Read more

How to install sublime text on Ubuntu ( Linux)

How to install sublime text on Ubuntu ( Linux)
Sublime text editor is a light weighted and best featured text editor available on web. It offers both trail version and licenced version of sublime. It is the best text editor for development and especially for python development. Sublime is a popular cross-platform text editor. Sublime Text editor offers official Linux apt repository to make it e

Read more

How to install python virtualenv?

How to install python virtualenv?
virtualenv is a python package. It is used to create an isolated python environments. virtualenv allows us to work with different versions of packages for different projects. when we work with projects, the requirements will change from project to project. If we use python package lets say celery==1.0 in some projects we may need to use celery==2.0

Read more

How to Install pip in Ubuntu (Linux)

How to Install pip in Ubuntu (Linux)
pip stands for "preferred installer program". pip - python package manager is used to manage and install python packages software packages. It is a package management system.we can find all python packages irrespective of the python version python2 or python3 which were uploaded to Python Package Index(PyPI). pip is the python package manger used t

Read more

install pip on windows

install pip on windows
pip - python package manager. It manages the python packages. It's an opensource software. pip stands for "preferred installer program".pip is used to install and manage software packages written in Python. It is a package management system.we can find all python packages irrespective of the python version python2 or python3 which were uploaded to

Read more

how to install postgresql on windows

To install PostgreSQL on your windows OS follow the given steps and make sure you have turned Third Party Antivirus off while installing. It's always recommended to install the latest version of PostgreSQL because, if any bugs are in the older version that fixed in the new versions. Go to the url "https://www.openscg.com/bigsql/postgresql/installer

Read more

how to install python on windows

To install python on windows go to "python software download for windows" and choose the python version and download it. Most of the python applications are upgraded to python3 so, I recommend you to download the python version 3. After downloading follow the below steps to install it Go to the directory where the python software is downloaded Sele

Read more

reading and writing csv files using python

reading and writing csv files using python
CSV is stands for comma seperated values. CSV file format is most commonly used format for imports and exports of data to spreadsheets and databases. Advantages to using csv edit csv file manually with any text editor ease of parsing and implementing the data in csv faster to handle the csv and smaller file size csv is considered to be standard fo

Read more

python memory management - memory allocation and garbage collection

python memory management - memory allocation and garbage collection
Memory allocation in python In python everything is considered as an object. In python we do not have variables instead python has names. When we declare a name/variable in python it stores the name in the memory. Every python name/variable points to its reference in the memory and reference points to the object. Let's consider the example code "a

Read more

signup or sign-in using facebook to django application

signup or sign-in using facebook to django application
Nowadays most of the users are having the facebook account. Registration/Login will take the time fill the form and submit to create or login to our website. Adding the functionality to login/signup with facebook makes it very easy to login or to register to our website. There are many third party django packages are available to add facebook signu

Read more

signup or sign-in using google to django application

Nowadays most of the users are having the facebook account. Registration/Login will take the time fill the form and submit to create or login to our website. Adding the functionality to login/signup with google makes it very easy to login or to register to our website. There are many third party django packages are available to add google signup or

Read more

generators and its usage in python

generators and its usage in python
Lets start with generators and its usage in python. A generator is a function in python which returns a python object. The returned object is an iterable object it like an array. Every object in the array is just a lazy function with parameters are ready for call. Generators are memory efficient because of its lazy evaluation. When we call method "

Read more

understanding of python slice notation

understanding of python slice notation
Lets start with understanding of python slice notation. We can access element in python lists/iterables by indexing. Slicing in python lists is defined as taking a part of the list from a bigger list. In python slicing takes 3 arguments 1. start index, 2. end index, 3. step to skip number of indexes. when we take slice in list it will create a new

Read more

Basic understanding of class in python

Basic understanding of class in python
Before starting with understanding classes in python lets talk about the basic terminology of object oriented programming. Class: A class is a basic design or a plan to an object. Class explains about the properties and behaviour of an object. In other words a class can be defined as it is a blueprint that defines the variables and methods common t

Read more

how to use *args and **kwargs in python

how to use *args and **kwargs in python
Python programming language is a simple and powerful language. It provides simple syntax with powerfull features. In this article we will discuss how to use *args and **kwargs in python. *args and **kwargs are magic powers of python. we use *args for unpacking of arguments and **kwargs for unpacking of keyword arguments. {% include "adsense/respon

Read more

iterators in python

iterators in python
Iterators in python is one of the simple and strong features of python. We already know that in python everything's an object. So, iterator is also a python object, which has a special method called "next". In python iterator acts like a container. When we call method "next" on the iterator object. It will creates and return the objects onfly. Aft

Read more

Support Me on Patreon
Blog Archive