An overview of Django.

shreyashi shreya
funccFORCE
Published in
3 min readApr 7, 2021

What is Django?

Django is a Web Application Framework written in python language, which is used to develop web applications.

Why have we used this particular framework?

We have used Django because it provides a rapid development feature, once you get the requirements of the client you can develop easily,

it takes less time to build an application.

Django open source or not?

Django is an open-source web application framework. It is publicly available without cost.

How to install Django?

Go to the official site, where you will find many links, before installing Django you must have any python version installed,

Django requires pip to start the installation.

Pip is a package management system and is used to install and manage packages written in python.

How to start Django Project?

We can start a Django project either by typing commands on cmd or on a terminal of Pycharm.

django-admin startproject projectname

Now make an app within the project

python manage.py startapp appname

Django project runs applications without any external web server.

python manage.py runserver

About Django

Django is a collection of three important components: Model, View, and Template. The model handles the database, the view is a python function that is used to perform some business logic and return a response to the user. and templates contain HTML and nonhtml files, views help to build logic and interact with models.

Each model class maps to a single table in the database and is a subclass of django.db.models.Model .

Since Django is a web application framework, it gets user requests by URL locator and responds back. To handle URLs, the django.urls module is used by the framework.

Apart from data handling we also need to handle and manage static resources like CSS, JavaScript, images, etc. for this purpose we use static files.

Django.ModelForm is a class that has an effective way to create a form without writing HTML code.

Django has one more class named Forms which is similar to ModelForm but it does not use Model. We can submit the Django form only if it contains a CSRF token otherwise it will throw an error.

The settings.py file contains all the project settings along with database connection details, SQLite is the default database, but if required you can configure other databases too.

After this, we will have to make migrations so that it applies the changes we have made to a model.

As we know Django is a web framework so it works on client-server architecture to implement web applications and for this, it has two classes HttpResponse and HttpRequest.

For design purposes, we have used bootstrap. Bootstrap enhances the user interface.

Django provides a feature to directly deploy on Github, the only prerequisite is we must have a GitHub account.

My Experience :

Before starting this project I had no idea what Django is, after getting the project the first thing I searched was what is Django. Then I went to youtube and searched Django, I started following the playlist and in parallel, I was doing the project and for the theory part, I was referring to some tutorials.I have faced so many errors while doing the project, some of them are “csrf token missing” , “404 not found” etc. The actual error displayed on the URL was Forbidden (403) CSRF verification failed. Request aborted. The reason given was: CSRF token missing, after searching a lot on google I found a solution {% csrf_token %} was missing in my form.

Another error i faced was during making migrations django.db.utils.ProgrammingError: relation “users_user” does not exist, this error was resolved what I did was to run python manage.py makemigrations <app_name> and do not forget to add <app_name> to INSTALLED_APPS in your settings.py file.

After resolving errors, our project finally got completed.

This was the initial project we made.

--

--