What is Django: First Impressions?
Tags: python, django, programming, codenewbie
Published: 2023-08-29 02:01:16

Once you have learned the fundamentals of programming concepts, you are eager to try something new. That was the feeling I got when I decided to plunge into Django.

In the past, I didn't want to learn about Django because of the term used in its description as the web framework for **PERFECTIONIST**. It felt strange to pick up Django during my early stage of learning about programming. I am still trying to figure out the reason.

But today, I am comfortable using it as I took my time to learn and master the skill to the best of my ability with a structured course that took me from zero to hero. 

Now, to my first impressions about this tech stack.

## What is Django?
You want to know the definition whenever you pick up a new interest.

**Fact**: The name Django originated from the Jazz guitarist Django Reinhardt

Django, in simple terms, is a programming language based on Python. It is an open-source framework written in Python that enables developers to build robust and scalable web applications quickly. Furthermore, it is the web framework for perfectionists with deadlines.

In addition, Django follows the **MVT** (model, view, template) pattern, which means the following:


![The MVT pattern](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cv9hm51ur0wre7i2g4ld.png)

A user makes a request to a website and sends it to the server, then Django resolves the request to a URL. 

After that, the request is passed to a specific **View** associated with the URL containing the Python file's logic. 

The View handles presenting the correct data and HTML templates that interact with the **Model** (database information), like querying some data about a page to display.

Once done, the Templates (HTML), the visual interface that the user sees, are packaged and sent back as a response.

Check out the [Django project](https://www.djangoproject.com/) to learn more.

Some companies that use Django:

- Spotify
- Instagram

## Installation and setup
Before writing code scripts, install some of these recommended [VS Code](https://code.visualstudio.com/download) extensions when using Django.

1. [Python](https://marketplace.visualstudio.com/items?itemName=ms-python.python): IntelliSense (Pylance), Linting, Debugging (multi-threaded, remote), code formatting, refactoring, unit tests, and more.

2. [Django](https://marketplace.visualstudio.com/items?itemName=batisteo.vscode-django): Beautiful syntax and scoped snippets for perfectionists with deadlines.

Update your VS Code settings to recognize Django templates using this process:

- Click settings (from the bottom left gear icon)

- Search “include languages” in the top setting search bar

- Under Emmet: Include Languages click ‘Add Item’

- Add ‘django-html’ for Item key and ‘html' for Value

| Item      | Value |
| ----------- | ----------- |
| django-html      | html       |

## Why learn Django?
The unique differentiator of why you should learn Django is its many functionalities embedded in one framework, from building web page views to creating APIs, authentication, and more.

These are some reasons why Django is the one:

- If you already know Python, it is quick to understand because of its syntax

- Object Relational Mapper (ORM) (no raw SQL): lets you interact with your database in Python without raw SQL queries that are long and time-consuming to write

- Admin interface GUI: Store data in the admin dashboard. It comes pre-built in Django

- Handles security

- User authentication that comes with packages that make it robust

Django ranks as one of the most popular backend frameworks to use.

## Conclusion
In this guide, you have learned the primary use of Django, its setup, and its benefits.

As you are enlightened about Django, I will be showcasing the use of Django in demos. Django has impressed me, and I'm no longer avoiding using it.

Would you try Django for your next project?

If you found this helpful, let's connect and spread the gospel of Django one step at a time.