Django Basic-2-Advance
django-tutorial

Django Basic-2-Advance

What is framework ?

A framework is a set of conceptual structure and guidelines, used to build something useful.

A framework may include predefined classes and functions that can be used to process input, manage hardware devices, and interact with system software.

The purpose of framework is to allow developers to focus on building a unique features for thier Projects rather than writing code from scratch.

Advantages :-)

  • Collection of tools
  • No need to start from scratch
  • Save Time
  • Improve Productivity
  • Clean Code
  • Reusable Code
  • Testing
  • Debugging

Web Framework - A web framework ( WF ) or Web Application framework ( WAF ) which helps to build web applications.

It provides tools and libraries to simplify common web development operations. This can incude web services, APIs, and other resources.

Web frameworks help with a variety of tasks, from templating and database access to session management and code resuse.

Some Web Framework

  • Laravel
  • Codeigniter
  • Zend
  • Django
  • Spring

Model View Template ( MVT ) - The MVT is an design pattern that separates an application into three main logical components Model, View and Template.

Each of these component has thier own role in a project.

Model - The Model responsible to handle database. It is a data access layer which handles the data.

View - The user can send request by interacting with template , the view handles these requests and sends to Model then get appropriate response from Model, sends response to template. It may also have requires logics. It works as a mediator between Template and Model.

Template - It represents how data should be presented to the application user. User can read or write the data from template.

Basically , It is responsible for showing end user content, we can say it is user interface. It may consists of HTML/CSS/JS mixed with Django Template Language.

Article content
MVT Design


Why Use MVT ?

  • Organized Code
  • Independent Block
  • Reduces the complexity of web applications
  • Easy to maintain
  • Easy to modify

Django

Django is a free , open-source , Python based High-Level Web Framework.

It follows the Model View Template ( MVT ) architecture pattern.

It was originally createdby Adrian Holovaty and Simon Willision.

It was created on 2003 at Lawrence Journal World Newspapaer.

It was released publicly under a BSD license in July 2005.

In june 2008, it was announce that DJango Software Foundation ( DSF ) would maintain Django in the future.

What we can build with Django ?

  • We can build high end web application
  • It encourages rapid development and clean , pragmatic design

Advantages :-)

  • Open Source
  • Fast
  • Secure
  • Scalable
  • Authentication
  • Versatile
  • Provide development web server by default
  • Provide SQLite Database by default

Django Project Directory Structure

Article content
file structures

__init__.py : The folder which contains init.py file is considered as python package.

wsgi.py : WSGI ( Web Server Gateway Interface ) is a specification that describes how a web server communicates with web application, and how web applications can be chained together to process one request. WSGI provides standard for synchronous Python apps.

asgi.py : ASGI ( Asynchronous Gateway Interface ) is a spritual successor to WSGI, intended to provide a standard interface async-capable Python web servers, frameworks, and applications. ASGI provides standard for both asynchronous and synchronous apps.

settings.py : The file contains all the information or data about project settings. Eg. Database config information, template , installed app, validators, middleware etc.

Some Basic Django Commands

Install Django

  1. download Python
  2. install django

    pip install django        

Create Project

django-admin startproject PROJECT_NAME        

Create App

python manage.py startapp APP_NAME        

Run Project

python manage.py runserver        

Create Database

python manage.py makemigrations
python manage.py migrate        

Create Superuser

python manage.py createsuperuser        

Dis Advantages

  • Not suitable for smaller projects
  • Monolithic

Conclussion

Django is a high-level Python web development framework that enables rapid development and clean, pragmatic design. The system follows the Model View Controller architectural pattern and earns recognition for its stability, flexibility, and well-documented codebase. If you’re looking for an experienced team to help you build your next project on this powerful framework. We have years of experience working with Django and other leading technologies, so we can help you create a product that exceeds your expectations.








To view or add a comment, sign in

More articles by Rahul Rathour

  • Docker

    Docker is an open -source platform that allows you to automate the deployment and management of applications within…

  • NLP Pipeline

    Set of the steps in which used to implement a NLP software called NLP Pipeline. Following are the steps : Data…

  • Everything know about the Python

    Python is a general purpose and high level programming language which introduced by Guido van Rossum in 1991. It is…

  • What is Devin AI ?

    Devin is not just a program; it's a groundbreaking AI that acts as a software engineer, capable of coding, debugging…

  • TRANSFORMERS

    A Transformer Model is a type of deep learning model that was introduced in 2017. The model was wirst described in 2017…

  • NLP

    NLP stands for Natural Language Processing. It is a subfield of linguistics, computer science and artificial…

  • GEMINI AI MODEL

    Gemini is a new and powerful artificial intelligence model from Google that can understand not just text but also…

Insights from the community

Others also viewed

Explore topics