Photo by Faisal M on Unsplash

All you need to know about Django….

Shreyas Mahajan
GDSC DYPCOE
Published in
4 min readJul 1, 2020

--

Topics covered:

  1. Introduction.
  2. Who uses it?
  3. Pathways to learn Django.
  4. Skills Required
  5. Security in Django
  6. What’s Different in Django as compared to other Web Framework
  7. Structure of Django Application
  8. Realtime Application

Introduction:

Django is a Python-based free and opensource web framework by which we can create a powerful web-applications. According to a recent survey of GeeksforGeeks and Hackr.io Django ranks 2nd most advanced framework for creating web applications.

Who uses it?

Most of the popular applications like Instagram, Spotify, Youtube, Dropbox, Bitbucket, Mozilla, Prezi, Facebook, Netflix, Yahoo maps 😃 were developed in Django.

Some of the applications developed in Django Framework

What’s Different in Django as compared to other Web Framework:

^ To develop a project in Django all you need to know is the most popular language *Python and other languages such as HTML, CSS, JAVASCRIPT which might be known by most of the developers as the journey of Programming starts from it.

^ NO need to learn the Structured Query Languages such as SQL, NO-SQL, etc. it will be handled by Python itself.

^ Django allows the developers to divide the projects into multiple applications due to which it gets easier for developers to develop the code and reuse the part of the code in other projects.

^ Easy integration: According to the structure of Django it is very easy to integrate the frontend part with backend.

^ As the python is the famous language most of the Hosting services like Heroku, Cpanel, AWS Lambda, PythonAnywhere, Digital Ocean supports the Django application to make the Projects live on the internet.

^ With the greater performance, Django keeps your web app secured and safe.

Skills Required:

# Just the Python basis such as classes, function, a little bit of data-structure, and the use of different libraries.

# A good knowledge about HTML, CSS, and a bit understanding of JAVASCRIPT will do.

# And of course the Django-Framework (Python language).

Security in Django:

Cross-site request forgery (CSRF) protection:

This ensures that a malicious user cannot “replay” a form POST to your website and have another logged in user unwittingly submit that form.

SQL injection protection:

Django’s querysets are protected from SQL injection since their queries are constructed using query parameterization. A query’s SQL code is defined separately from the query’s parameters. Since parameters may be user-provided and therefore unsafe, they are escaped by the underlying database driver.

Clickjacking protection:

Django contains clickjacking protection in the form of the X-Frame-Options middleware which in a supporting browser can prevent a site from being rendered inside a frame

SSL/HTTPS:

It is always better for security to deploy your site behind HTTPS. Without this, it is possible for malicious network users to sniff authentication credentials or any other information transferred between client and server, and in some cases — active network attackers — to alter data that is sent in either direction.

and many more…

Structure of Django Application:

Broadly the Django application is divided into three parts Model, Template, View

  • Model in Django handles all the database part in a project
  • Templates contain all static files like HTML, CSS, javascript, media files like photos, videos, etc
  • View is the backbone of the Django project which handles all logical parts.

In the following chart, you will get the basic structure of Django…

As we all know this file will need the connection between them they are as follows…

As we said the view is the linker between frontend and backend. Inside a function written in view, the data is called from the database, and it's getting return to the template and inside it, the data is represented.

Model —>View —>Template

structure of Django

Pathways to learn Django

  • First of all, you try to design simple webpages using HTML, CSS, Javascript
  • After mastering webpages, keep learning python side-by-side.
  • After all, you are set to learn the Django-framework in that you need to learn, how to make models, creating the views in python linking that views to urls.py kinds of stuff….

Realtime Application:

Requirements for the realtime application is

  • A Django project
  • Knowledge about Hosting website
  • Backend database like PostgreSQL for storing the data
  • Amazon Web Services for storing the media/static files

By integrating all the above points you are ready with your project live on the internet…

“Thank you for reading patiently !!!”

--

--

Shreyas Mahajan
GDSC DYPCOE

Enthusiastic developer, Always curious about "How it works ??"