Virtual environment in Python is a very useful concept. It helps us to manage our project dependencies properly and efficiently. In this article we will see how to create a virtual environment for our Python projects. Also how to create a
Virtual environments helps us to separate dependencies between different projects. A Python project may have a bunch of dependencies installed. And most of the time they differ from other projects’ dependencies. We don’t want to mix them up. Also dependencies get updated all the time. A project made with a previous version of a dependency may not work…
Python is a multi-paradigm programming language. It supports different programming paradigms like procedural programming, object-oriented programming and functional programming. In this article we will understand the basic concepts of functional programming.
Functional programming is a programming paradigm, a style to organize our code. Separation of data and functions is the main idea of functional programming. Where data is to be acted upon and functions will act or determine what to do.
In functional programming, we write the code in pure mathematical function style.
Using Auto PY to EXE we can convert
.py files to
.exe files very easily. This way our Python project will act like a desktop application. And we will be able to run the application in other windows machines without installing Python.
In this article you will learn how to convert a Python project to an executable file. The process will work whether your application has just one
.py file or a several
.py files. Note that Auto PY to EXE works only in Python version 3.5 or higher. So you can’t use it in Python version lower than 3.5.
Django is a popular Python web framework for developing web applications. It follows the Model-View-Template(MVT) design pattern. So before starting to develop web applications with Django it is mandatory to understand the basics of MVT design architecture of a Django application. In this article I will talk about the basic understanding of MVT design pattern in Django.
MVT stands for Model-View-Template. Sometimes it is also referred as MTV(Model-Template-View). MVT is a design pattern or design architecture that Django follows to develop web applications. It is slightly different from the commonly known MVC(Model-View-Controller) design pattern. MVT determines the total structure and…
We can handle user authentication for our Django project very easily using the
UserCreationForm. In this article I will discuss how to handle user registration, login and logout in a Django application.
First we will create a project named
demo. I am using Django version 3.2. Check your Django version before following this article.
django-admin startproject demo
Then inside the project we will create an app named
users. Keeping a specific portion of a Django project as an app like this is good practice.
python manage.py startapp users
In Python everything is considered as an object. Some of them are mutable and some of them are immutable. As we go further in our Python journey understanding the fundamentals like this becomes very important.
“An immutable object(unchangeable object) is an object whose state cannot be modified after it is created. This is in contrast to a mutable object (changeable object), which can be modified after it is created “— From Wikipedia.
So we can change mutable objects but can’t change immutable objects. But what does it actually mean? …
We can make some awesome design for our website using only CSS. In this article I will show you how we can make a profile card with some cool hover effects. Let’s get started.
Inside our project folder we need one HTML file, one CSS file and a folder to store profile image.
Opening a GitHub account is fairly easy. Just go to github.com, hit sign up and create an account.
To install git on you windows…
A Python set is a collection of unordered data with no duplicate values. Like a list a set is also a sequence of data. But unlike a list a set can’t have duplicate elements in it.
A set is an unordered collection with no duplicate elements — definition of a set from Python documentation.
Python sets are same as mathematical sets and support operations of mathematical set theory like intersection and union. But it is not required to be a pro in set theory to understand Python sets!
In this article we will see how to create a set and…
Decorators allow us to add more functionalities in a Python function. It is called metaprogramming because one part of the program adds something to another part of the program at compile time.
A decorator is a design pattern in Python that allows a user to add new functionality to an existing object without modifying its structure. Decorators are usually called before the definition of a function you want to decorate. — Datacamp’s definition of a decorator.
Decorators are used on top of a function and starts with @ sign. Following is the basic structure to use a decorator:
Undergraduate CS student | Passionate about programming and tech