SlideShare a Scribd company logo
2
Most read
3
Most read
5
Most read
Django Workflow and Architecture
Django Workflow and Architecture
What is Django?
Django is a free and open source web application framework written in Python. A framework is
nothing over a group of modules that create development easier. They're sorted along, and
permit you to make applications or websites from associate existing supply, rather than from
scratch.
When you are building a website, you mostly would like the same set of components: how to
handle user authentication (signing up, signing in, sign language out), a management panel for
your web site, forms, how to transfer files, etc.
Frameworks exist to save lots of you from having to reinvent the wheel and to assist alleviate a
number of the overhead once you’re building a replacement web site and Django framework is
one in all them.
The official project web site describes Django as “a high-level Python net framework that
encourages fast development and clean, pragmatic style. It takes care of lot of effort of net
development, thus you'll be able to target writing your app with no need to reinvent the wheel.
It’s free and open supply.”
Django offers an enormous assortment of modules that you'll be able to use on your own.
Primarily, frameworks exist to save lots of developers tons of wasted time and headaches and
Django isn't any totally different.
Django Architecture
MVT is generally very similar to that of MVC which is a Model, View, and Controller. The
distinction between MVC and MVT here is that Django itself will do the work done by the
controller half within the MVC design. Django will do this work of the controller by victimization
templates. Precisely, the template file may be a mixture of hypertext markup language half and
Django example Language conjointly referred to as DTL.
Django follows the MVT framework
for architecture
M stands for Model
V stands for View
T stands for Template
Benefits of Django Architecture
The Django Framework is predicated on this design and it really communicates between these 3
elements without having to put in writing complicated code. That’s why Django is gaining
quality.
This design in Django has numerous blessings like:
1. Rapid Development: Django design that separates in different components makes it
easy for multiple developers to work on different aspects of the same application
simultaneously. That's additionally one among the options of Django.
2. Loosely Coupled: Django has totally different elements that need one another at bound
elements of the application, at each instant, that will increase the safety of the general
website. Because the model file can currently solely save on our server instead of saving
on the webpage.
3. Ease of Modification:This can be a crucial fact of development as there area unit totally
different elements in Django design. If there's a modification in numerous elements, we
tend not to modify it in alternative elements. This can be really one among the special
options of Django, as here it provides us a way with more ability of our web site than
alternative frameworks.
4. Security:Whereas building high-end internet applications, security becomes a really
crucial facet to reflect on. Django understands this concern and provides its best
defender to avoid wasting your efforts. Using click-jacking, cross-site scripting, SQL
injections Django builds a robust wall for the application’s safety. User authentication is
additionally a crucial feature to securely manage user accounts and passwords that
Django provides.
5. Scalable:Scalability can be understood as an ability of an application to work well when
the size or volume of the platform increases. Django works effortlessly during this issue.
Websites created with Django have the capability to handle multiple users at one time.
Some well-liked websites victimization Django embody Spotify, Netflix, YouTube,
Mozilla, Quora, etc.
Creating a New Project in Django
To start a new Django project, run the command below:
django-admin startprojectmyproject
After we run the command above, it will generate the base folder structure for a Django
project.
Right now, our myproject directory looks like this:
myproject/ <-- higher level folder
|-- myproject/ <-- django project folder
| |-- myproject/
| | |-- __init__.py
| | |-- settings.py
| | |-- urls.py
| | |-- wsgi.py
| +-- manage.py
● manage.py: a shortcut to use the django-admin command-line utility. It’s used to run
management commands related to our project. We will use it to run the development
server, run tests, create migrations and much more.
● __init__.py: this empty file tells Python that this folder is a Python package.
● settings.py: this file contains all the project’s configuration. We will refer to this file all
the time!
● urls.py: this file is responsible for mapping the routes and paths in our project. For
example, if you want to show something in the URL /about/, you have to map it here
first.
● wsgi.py: this file is a simple gateway interface used for deployment.
Now everything is st up and we can run the server using below command
python manage.py runserver
Now open the URL in a Web browser: http://127.0.0.1:8000 and you should see the success
page, which means the server is running correctly.
Creating Django Apps
Django project contains many apps within it. An app can't run without a project. You can create
app by the following command
django-admin startapp articles
This will give us the following directory structure:
myproject/
|-- myproject/
| |-- articles/ <-- our new django app!
| | |-- migrations/
| | | +-- __init__.py
| | |-- __init__.py
| | |-- admin.py
| | |-- apps.py
| | |-- models.py
| | |-- tests.py
| | +-- views.py
| |-- myproject/
| | |-- __init__.py
| | |-- settings.py
| | |-- urls.py
| | |-- wsgi.py
| +-- manage.py
+-- venv
So, let’s first explore what each file does:
● migrations/: here Django stores some files to keep track of the changes you create in
the models.py file, so to keep the database and the models.py synchronized.
● admin.py: this is a configuration file for a built-in Django app called Django Admin.
● apps.py: this is a configuration file of the app itself.
● models.py: here is where we define the entities of our Web application. The models are
translated automatically by Django into database tables.
● tests.py: this file is used to write unit tests for the app.
● views.py: this is the file where we handle the request/response cycle of our Web
application.
Now that we created our first app, let’s configure our project to use it. Open settings.py file and
find installed_apps block.
settings.py
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'Django.contrib.staticfiles',
‘articles’
]
Here we have added ‘articles’ in the installed apps section. Now the app is ready to run with the
Django project.
Configuring Database
By default Django project comes with sqlite3 database but you can customize it to use MySQL
or Postgresql as per the requirements.
settings.py
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'blog',
'USER': 'postgres',
'PASSWORD': '**********',
'HOST': 'localhost',
'PORT': 5432,
}
}
Now your project is connected with Postgres database and ready to run.
Conclusion
In this blog we have learned how the MVT pattern works and the structure of Django
application along with the database configuration.

More Related Content

PDF
VLAN Trunking Protocol
PDF
DVB-T2 Lite vs. DAB+ for Digital Radio (English version)
PPTX
Wireless Networks Introduction
PDF
HA Deployment Architecture with HAProxy and Keepalived
PPTX
Lte(long term evolution) 4G LTE
PPTX
Bluejacking
PPTX
PPTX
Jini network technology
VLAN Trunking Protocol
DVB-T2 Lite vs. DAB+ for Digital Radio (English version)
Wireless Networks Introduction
HA Deployment Architecture with HAProxy and Keepalived
Lte(long term evolution) 4G LTE
Bluejacking
Jini network technology

What's hot (20)

PDF
Software Define Networking (SDN)
PPTX
PPTX
Network attached storage using raspberry pi
PDF
Advanced: True Fixed-Mobile Convergence (FMC) with 5G
PPTX
State Machines and PLC Programming.pptx
PDF
Peer to peer Networks
PPTX
Presentation on private 5G.pptx
PDF
Intermediate: 5G Applications Architecture - A look at Application Functions ...
PDF
Everything you ever needed to know about Kafka on Kubernetes but were afraid ...
PDF
VMware NSX and Arista L2 Hardware VTEP Gateway Integration
PDF
Addressing PNT threats in critical defense infrastructure
PPTX
Mavenir: Network Transformation for 5G Services
PPTX
Huawei Optix 8800 UPS (universal platform subrack)
PDF
Overview of standardisation status and 3GPP technology evolution trend
PPTX
Cisco CCNA- How to Configure Multi-Layer Switch
PPT
Le partage des fréquences radio: vers une gestion dynamique du spectre
PPTX
STARLINK.pptx
PDF
In-service synchronization monitoring and assurance
PDF
5 g core overview
Software Define Networking (SDN)
Network attached storage using raspberry pi
Advanced: True Fixed-Mobile Convergence (FMC) with 5G
State Machines and PLC Programming.pptx
Peer to peer Networks
Presentation on private 5G.pptx
Intermediate: 5G Applications Architecture - A look at Application Functions ...
Everything you ever needed to know about Kafka on Kubernetes but were afraid ...
VMware NSX and Arista L2 Hardware VTEP Gateway Integration
Addressing PNT threats in critical defense infrastructure
Mavenir: Network Transformation for 5G Services
Huawei Optix 8800 UPS (universal platform subrack)
Overview of standardisation status and 3GPP technology evolution trend
Cisco CCNA- How to Configure Multi-Layer Switch
Le partage des fréquences radio: vers une gestion dynamique du spectre
STARLINK.pptx
In-service synchronization monitoring and assurance
5 g core overview
Ad

Similar to Django Workflow and Architecture (20)

PPTX
Introduction to Django
PPTX
Basic Python Django
PDF
Django
PDF
Web development django.pdf
PPTX
Web development with django - Basics Presentation
PDF
Step-by-Step Django Web Development with Python
PPTX
Why Django for Web Development
PPTX
Advanced Web Technology using Django.pptx
PPTX
Unleash-the-power-of-Django.pptx
PPTX
PDF
Django in Action (MEAP V01) Christopher Trudeau
PPTX
Django Introdcution
ODP
Introduce Django
PPTX
Django Framework Overview forNon-Python Developers
PPTX
Django PPT.pptx
PPTX
Django Framework Interview Question and Answer partOne.pptx
PPTX
Django Framework Interview Guide - Part 1
PPTX
Sahil_18118_IOT-ppt.pptx
PDF
Django in Action (MEAP V01) Christopher Trudeau
Introduction to Django
Basic Python Django
Django
Web development django.pdf
Web development with django - Basics Presentation
Step-by-Step Django Web Development with Python
Why Django for Web Development
Advanced Web Technology using Django.pptx
Unleash-the-power-of-Django.pptx
Django in Action (MEAP V01) Christopher Trudeau
Django Introdcution
Introduce Django
Django Framework Overview forNon-Python Developers
Django PPT.pptx
Django Framework Interview Question and Answer partOne.pptx
Django Framework Interview Guide - Part 1
Sahil_18118_IOT-ppt.pptx
Django in Action (MEAP V01) Christopher Trudeau
Ad

More from Andolasoft Inc (20)

PDF
Scalable Mobile App Development for Business Growth1 (1).pdf
PDF
Latest Facts and Trends in Fitness App Development
PDF
Challenges of React Native App Development_ Effective Mitigation Strategies.pdf
PDF
How To Use Server-Side Rendering with Nuxt.js
PDF
Essential Functionalities Your Real Estate Web App Must Have.pdf
PDF
A Complete Guide to Developing Healthcare App
PDF
Game-Changing Power of React Native for Businesses in 2024
PDF
A Complete Guide to Real Estate Website Development
PDF
How to Build Cross-Platform Mobile Apps Using Python
PDF
Impact of AI on Modern Mobile App Development
PDF
How to Optimize the SEO of Shopify Stores
PDF
14 Tips On How To Improve Android App Performance
PDF
The Ultimate Guide to Setting Up Your WooCommerce Store
PDF
Ranking The Best PHP Development Companies in the World
PDF
Top 8 WordPress Design and Development Trends of 2023
PDF
List of 10 Best WordPress Development Companies
PDF
WooCommerce vs Shopify: Which is Better For Your Online Store
PDF
Why Choose WooCommerce For Your eCommerce Store
PDF
Service Oriented Architecture in NodeJS
PDF
Top Features And Updates Of Angular 13 You Must Know
Scalable Mobile App Development for Business Growth1 (1).pdf
Latest Facts and Trends in Fitness App Development
Challenges of React Native App Development_ Effective Mitigation Strategies.pdf
How To Use Server-Side Rendering with Nuxt.js
Essential Functionalities Your Real Estate Web App Must Have.pdf
A Complete Guide to Developing Healthcare App
Game-Changing Power of React Native for Businesses in 2024
A Complete Guide to Real Estate Website Development
How to Build Cross-Platform Mobile Apps Using Python
Impact of AI on Modern Mobile App Development
How to Optimize the SEO of Shopify Stores
14 Tips On How To Improve Android App Performance
The Ultimate Guide to Setting Up Your WooCommerce Store
Ranking The Best PHP Development Companies in the World
Top 8 WordPress Design and Development Trends of 2023
List of 10 Best WordPress Development Companies
WooCommerce vs Shopify: Which is Better For Your Online Store
Why Choose WooCommerce For Your eCommerce Store
Service Oriented Architecture in NodeJS
Top Features And Updates Of Angular 13 You Must Know

Recently uploaded (20)

PDF
20250805_A. Stotz All Weather Strategy - Performance review July 2025.pdf
PPTX
CkgxkgxydkydyldylydlydyldlyddolydyoyyU2.pptx
DOCX
unit 2 cost accounting- Tender and Quotation & Reconciliation Statement
PPT
Chapter four Project-Preparation material
PDF
Nidhal Samdaie CV - International Business Consultant
PDF
Traveri Digital Marketing Seminar 2025 by Corey and Jessica Perlman
PDF
Ôn tập tiếng anh trong kinh doanh nâng cao
PDF
Reconciliation AND MEMORANDUM RECONCILATION
PPTX
5 Stages of group development guide.pptx
PDF
Deliverable file - Regulatory guideline analysis.pdf
PDF
kom-180-proposal-for-a-directive-amending-directive-2014-45-eu-and-directive-...
PPTX
Probability Distribution, binomial distribution, poisson distribution
PDF
Elevate Cleaning Efficiency Using Tallfly Hair Remover Roller Factory Expertise
PDF
WRN_Investor_Presentation_August 2025.pdf
PPT
340036916-American-Literature-Literary-Period-Overview.ppt
PDF
IFRS Notes in your pocket for study all the time
PPTX
Business Ethics - An introduction and its overview.pptx
PDF
Roadmap Map-digital Banking feature MB,IB,AB
PPTX
AI-assistance in Knowledge Collection and Curation supporting Safe and Sustai...
PDF
A Brief Introduction About Julia Allison
20250805_A. Stotz All Weather Strategy - Performance review July 2025.pdf
CkgxkgxydkydyldylydlydyldlyddolydyoyyU2.pptx
unit 2 cost accounting- Tender and Quotation & Reconciliation Statement
Chapter four Project-Preparation material
Nidhal Samdaie CV - International Business Consultant
Traveri Digital Marketing Seminar 2025 by Corey and Jessica Perlman
Ôn tập tiếng anh trong kinh doanh nâng cao
Reconciliation AND MEMORANDUM RECONCILATION
5 Stages of group development guide.pptx
Deliverable file - Regulatory guideline analysis.pdf
kom-180-proposal-for-a-directive-amending-directive-2014-45-eu-and-directive-...
Probability Distribution, binomial distribution, poisson distribution
Elevate Cleaning Efficiency Using Tallfly Hair Remover Roller Factory Expertise
WRN_Investor_Presentation_August 2025.pdf
340036916-American-Literature-Literary-Period-Overview.ppt
IFRS Notes in your pocket for study all the time
Business Ethics - An introduction and its overview.pptx
Roadmap Map-digital Banking feature MB,IB,AB
AI-assistance in Knowledge Collection and Curation supporting Safe and Sustai...
A Brief Introduction About Julia Allison

Django Workflow and Architecture

  • 2. Django Workflow and Architecture What is Django? Django is a free and open source web application framework written in Python. A framework is nothing over a group of modules that create development easier. They're sorted along, and permit you to make applications or websites from associate existing supply, rather than from scratch. When you are building a website, you mostly would like the same set of components: how to handle user authentication (signing up, signing in, sign language out), a management panel for your web site, forms, how to transfer files, etc. Frameworks exist to save lots of you from having to reinvent the wheel and to assist alleviate a number of the overhead once you’re building a replacement web site and Django framework is one in all them. The official project web site describes Django as “a high-level Python net framework that encourages fast development and clean, pragmatic style. It takes care of lot of effort of net development, thus you'll be able to target writing your app with no need to reinvent the wheel. It’s free and open supply.” Django offers an enormous assortment of modules that you'll be able to use on your own. Primarily, frameworks exist to save lots of developers tons of wasted time and headaches and Django isn't any totally different.
  • 3. Django Architecture MVT is generally very similar to that of MVC which is a Model, View, and Controller. The distinction between MVC and MVT here is that Django itself will do the work done by the controller half within the MVC design. Django will do this work of the controller by victimization templates. Precisely, the template file may be a mixture of hypertext markup language half and Django example Language conjointly referred to as DTL. Django follows the MVT framework for architecture M stands for Model V stands for View T stands for Template
  • 4. Benefits of Django Architecture The Django Framework is predicated on this design and it really communicates between these 3 elements without having to put in writing complicated code. That’s why Django is gaining quality. This design in Django has numerous blessings like: 1. Rapid Development: Django design that separates in different components makes it easy for multiple developers to work on different aspects of the same application simultaneously. That's additionally one among the options of Django. 2. Loosely Coupled: Django has totally different elements that need one another at bound elements of the application, at each instant, that will increase the safety of the general website. Because the model file can currently solely save on our server instead of saving on the webpage. 3. Ease of Modification:This can be a crucial fact of development as there area unit totally different elements in Django design. If there's a modification in numerous elements, we tend not to modify it in alternative elements. This can be really one among the special options of Django, as here it provides us a way with more ability of our web site than alternative frameworks. 4. Security:Whereas building high-end internet applications, security becomes a really crucial facet to reflect on. Django understands this concern and provides its best defender to avoid wasting your efforts. Using click-jacking, cross-site scripting, SQL injections Django builds a robust wall for the application’s safety. User authentication is additionally a crucial feature to securely manage user accounts and passwords that Django provides. 5. Scalable:Scalability can be understood as an ability of an application to work well when the size or volume of the platform increases. Django works effortlessly during this issue. Websites created with Django have the capability to handle multiple users at one time.
  • 5. Some well-liked websites victimization Django embody Spotify, Netflix, YouTube, Mozilla, Quora, etc. Creating a New Project in Django To start a new Django project, run the command below: django-admin startprojectmyproject After we run the command above, it will generate the base folder structure for a Django project. Right now, our myproject directory looks like this: myproject/ <-- higher level folder |-- myproject/ <-- django project folder | |-- myproject/ | | |-- __init__.py | | |-- settings.py | | |-- urls.py | | |-- wsgi.py | +-- manage.py ● manage.py: a shortcut to use the django-admin command-line utility. It’s used to run management commands related to our project. We will use it to run the development server, run tests, create migrations and much more. ● __init__.py: this empty file tells Python that this folder is a Python package. ● settings.py: this file contains all the project’s configuration. We will refer to this file all the time! ● urls.py: this file is responsible for mapping the routes and paths in our project. For example, if you want to show something in the URL /about/, you have to map it here first.
  • 6. ● wsgi.py: this file is a simple gateway interface used for deployment. Now everything is st up and we can run the server using below command python manage.py runserver Now open the URL in a Web browser: http://127.0.0.1:8000 and you should see the success page, which means the server is running correctly. Creating Django Apps Django project contains many apps within it. An app can't run without a project. You can create app by the following command django-admin startapp articles This will give us the following directory structure: myproject/ |-- myproject/ | |-- articles/ <-- our new django app! | | |-- migrations/ | | | +-- __init__.py | | |-- __init__.py | | |-- admin.py | | |-- apps.py | | |-- models.py | | |-- tests.py | | +-- views.py | |-- myproject/ | | |-- __init__.py | | |-- settings.py | | |-- urls.py | | |-- wsgi.py | +-- manage.py +-- venv
  • 7. So, let’s first explore what each file does: ● migrations/: here Django stores some files to keep track of the changes you create in the models.py file, so to keep the database and the models.py synchronized. ● admin.py: this is a configuration file for a built-in Django app called Django Admin. ● apps.py: this is a configuration file of the app itself. ● models.py: here is where we define the entities of our Web application. The models are translated automatically by Django into database tables. ● tests.py: this file is used to write unit tests for the app. ● views.py: this is the file where we handle the request/response cycle of our Web application. Now that we created our first app, let’s configure our project to use it. Open settings.py file and find installed_apps block. settings.py INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'Django.contrib.staticfiles', ‘articles’ ] Here we have added ‘articles’ in the installed apps section. Now the app is ready to run with the Django project. Configuring Database By default Django project comes with sqlite3 database but you can customize it to use MySQL or Postgresql as per the requirements. settings.py
  • 8. DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': 'blog', 'USER': 'postgres', 'PASSWORD': '**********', 'HOST': 'localhost', 'PORT': 5432, } } Now your project is connected with Postgres database and ready to run. Conclusion In this blog we have learned how the MVT pattern works and the structure of Django application along with the database configuration.