Introduction to Django models In Django, a model is a subclass of the django.db.models.Model class. A model contains one or more fields and methods that manipulate the fields. Essentially, a Django model maps to a single table in the database in which each field of the model represents a column in theContinue Reading

Introduction to the Django templates In the previous tutorial, you learned how to return a HttpResponse with a h1 tag from a view. To return a full HTML page, you need to use a template. A template is a file that contains the static and dynamic parts of a webpage. To generate the dynamicContinue Reading

Django projects and applications In the Django framework: A Django project may have one or more applications. For example, a project is like a website that may consist of several applications such as blogs, users, and wikis. Typically, you design a Django application that can be reusable in other DjangoContinue Reading

Django overview Django is a Python web framework that includes a set of components for solving common web development problems. Django allows you to rapidly develop web applications with less code by taking advantage of its framework. Django follows the DRY (don’t repeat yourself) principle, which allows you to maximize the codeContinue Reading

Installing NumPy Library In this tutorial, we will cover the installation of Numpy in the Windows operating system as well as in Linux and we will also learn how to import NumPy in your code and then use it. If you want to work with Numpy then you must need to install it first before moving on toContinue Reading

Python Classes and Objects Classes and objects are the two main aspects of object-oriented programming. A class is the blueprint from which individual objects are created. In the real world, for example, there may be thousands of cars in existence, all of the same make and model. Each car wasContinue Reading

Exception Handling in Python The cause of an exception is often external to the program itself. For example, an incorrect input, a malfunctioning IO device etc. Because the program abruptly terminates on encountering an exception, it may cause damage to system resources, such as files. Hence, the exceptions should beContinue Reading

File Handling As the part of programming requirement, we have to store our data permanently for future purpose. For this requirement we should go for files. Files are very common permanent storage areas to store our data. Types of Files:There are 2 types of files Text Files:Usually we can useContinue Reading

It is an encapsulation mechanism to group related modules into a single unit. package is nothing but folder or directory which represents collection of Python modules. Any folder or directory contains __init__.py file,is considered as a Python package. This file can be empty. A package can contains sub packages also.Continue Reading

Modules A group of functions, variables and classes saved to a file, which is nothing but module. Every Python file (.py) acts as a module. Ex: dharshimath.pyx=888def add(a,b): print(“The Sum:”,a+b)def product(a,b): print(“The Product:”,a*b) dharshimath module contains one variable and 2 functions. If we want to use members of module inContinue Reading