Django: A Powerful Python Based Web Application Framework - Karpagam Institute of Technology
Seerapalayam Village, Coimbatore – 641 105

Django: A Powerful Python Based Web Application Framework

Hello! I am not writing this blog based on my technical experience, it’s purely because of my love with Django. Are you familiar in Python basics and OOPS concepts and thinking to upskill your knowledge in python?

Then try Django: A Powerful framework to build web applications easily, most of you know the popular Instagram was developed on Django. Here are the few features and Benefits of the Django Web Framework.

 Features of the Framework:

The Django has come with most powerful features that makes developer life easier to build large scale Web Applications.

Let us start with ORM (Object Relational Mapping), ORM is in the frontline of Django to make the developer life easier. ORM is the concept of Mapping Objects in Programming to the Relational Database, it means you need not worry about Data Base Design and Queries. Here are the few layman examples of ORM.

  1. Just Design Classes in Model for your application, Django converts it into Relational Databases.

Example:

Class Customer:

               Name = models.CharField(max_length=30)

               Mobile_no = models.CharField(max_length=10)

               Age = models.IntegerField()

Even, Association and Aggregation Relationships in object oriented programming are converted into One-to-one and Foreign Key relationships.

  1. Just call a filter function instead of writing SQL queries

Customer.objects.filter(age__gte=20)

Select * from Customer where age >= 20

Developers could also write sub queries and complex joins in the simple way by calling ORM functions. Even Aggregate functions are very easy here.

Next when coming to MTV (Model View Template), it helps to isolate the Database layer, Business layer and the User Interface layer.  This isolation helps to manage and modify the Project easily. For Example, the changes in presentation will not affect the database and business logic.

Forms and Jinja templates are used to reduce the complexity of presenting data in the user interface. Forms helps us to create html input fields from the models, and customizing the form inputs like filtering drop down list and validations are very easy here. Jinja Templates help us to integrate python code through template tags, hence bringing data to html is very easy.

Authentication and Authorization System are very strong to ensure the security in single line called decorators. The Django Authentication and Authorization comes with default User Model, Groups, Permissions, and more. This framework has built on the Session Framework and it performs user credential verification, checks and controls the user permission to access any resources.

We could write views in two different methods, first one is Function Based View and the second is Class based views, both have merits and demerits. But Class based generic views are very exciting, since in to two or three lines developers can simply do the CRUD operations. I will write a separate blog post to explore my excitement on Class Based Views.

In all together, the thing I am wondering is the default connection available in framework between Model, forms and Templates, which helps developer like nothing to develop web applications.

The Following are the useful resource that helps newbies to learn Web Application Development using Django.

  1. Django Official Documentation https://docs.djangoproject.com/en/3.1/
  2. To Get Started:

https://www.djangoproject.com/start/

https://developer.mozilla.org/en-US/docs/Learn/Server-side/Django

  1. Django Forum: https://forum.djangoproject.com/
  1. Useful Resource to Learn Python Basics:

https://docs.python.org/3/tutorial/

Python Programming Examples

My suggestion is right path to learn any language or framework is start to write code rather than keep on studying topic by topic.

P N Ramesh

Assistant Professor, Technology Trainer and Web Developer,

Department of Computer Science and Engineering,

Karpagam Institute of Technology