Movatterモバイル変換


[0]ホーム

URL:


Andolasoft Inc, profile picture
Uploaded byAndolasoft Inc
385 views

Django Workflow and Architecture

Django is a free and open-source web application framework written in Python that simplifies web development through its MVT architecture, which stands for Model, View, and Template. It offers benefits such as rapid development, security, scalability, and ease of modification, making it a popular choice for developers. The document also outlines how to create a new Django project and app, as well as how to configure a database for the project.

Embed presentation

Download to read offline
Django Workflow and ArchitectureWhat is Django?Django is a free and open source web application framework written in Python. A framework isnothing over a group of modules that create development easier. They're sorted along, andpermit you to make applications or websites from associate existing supply, rather than fromscratch.When you are building a website, you mostly would like the same set of components: how tohandle user authentication (signing up, signing in, sign language out), a management panel foryour 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 anumber of the overhead once you’re building a replacement web site and Django framework isone in all them.The official project web site describes Django as “a high-level Python net framework thatencourages fast development and clean, pragmatic style. It takes care of lot of effort of netdevelopment, 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 andDjango isn't any totally different.
Django ArchitectureMVT is generally very similar to that of MVC which is a Model, View, and Controller. Thedistinction between MVC and MVT here is that Django itself will do the work done by thecontroller half within the MVC design. Django will do this work of the controller by victimizationtemplates. Precisely, the template file may be a mixture of hypertext markup language half andDjango example Language conjointly referred to as DTL.Django follows the MVT frameworkfor architectureM stands for ModelV stands for ViewT stands for Template
Benefits of Django ArchitectureThe Django Framework is predicated on this design and it really communicates between these 3elements without having to put in writing complicated code. That’s why Django is gainingquality.This design in Django has numerous blessings like:1. Rapid Development: Django design that separates in different components makes iteasy for multiple developers to work on different aspects of the same applicationsimultaneously. That's additionally one among the options of Django.2. Loosely Coupled: Django has totally different elements that need one another at boundelements of the application, at each instant, that will increase the safety of the generalwebsite. Because the model file can currently solely save on our server instead of savingon the webpage.3. Ease of Modification:This can be a crucial fact of development as there area unit totallydifferent elements in Django design. If there's a modification in numerous elements, wetend not to modify it in alternative elements. This can be really one among the specialoptions of Django, as here it provides us a way with more ability of our web site thanalternative frameworks.4. Security:Whereas building high-end internet applications, security becomes a reallycrucial facet to reflect on. Django understands this concern and provides its bestdefender to avoid wasting your efforts. Using click-jacking, cross-site scripting, SQLinjections Django builds a robust wall for the application’s safety. User authentication isadditionally a crucial feature to securely manage user accounts and passwords thatDjango provides.5. Scalable:Scalability can be understood as an ability of an application to work well whenthe 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 DjangoTo start a new Django project, run the command below:django-admin startprojectmyprojectAfter we run the command above, it will generate the base folder structure for a Djangoproject.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 runmanagement commands related to our project. We will use it to run the developmentserver, 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 allthe time!● urls.py: this file is responsible for mapping the routes and paths in our project. Forexample, if you want to show something in the URL /about/, you have to map it herefirst.
● 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 commandpython manage.py runserverNow open the URL in a Web browser: http://127.0.0.1:8000 and you should see the successpage, which means the server is running correctly.Creating Django AppsDjango project contains many apps within it. An app can't run without a project. You can createapp by the following commanddjango-admin startapp articlesThis 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 inthe 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 aretranslated 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 Webapplication.Now that we created our first app, let’s configure our project to use it. Open settings.py file andfind installed_apps block.settings.pyINSTALLED_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 theDjango project.Configuring DatabaseBy default Django project comes with sqlite3 database but you can customize it to use MySQLor 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.ConclusionIn this blog we have learned how the MVT pattern works and the structure of Djangoapplication along with the database configuration.

Recommended

PPTX
Introduction to Django
PDF
Django Tutorial | Django Web Development With Python | Django Training and Ce...
PPTX
Osgi
PPTX
Library Management System
ODP
An Introduction to Vuejs
PDF
Expressjs
PPTX
Master page in Asp.net
DOCX
Super marketbillingsystemproject
PPTX
Basic Python Django
PPTX
Django Girls Tutorial
PPTX
Internship Presentation 2 Web Developer
PPTX
An introduction to Vue.js
PDF
Vue.js
ODP
Routing & Navigating Pages in Angular 2
PDF
Why Vue.js?
PPTX
Its time to React.js
PPT
Joomla
PDF
Wordpress CMS tutorial and guide manual
PDF
Understanding Sling Models in AEM
PPTX
Virtualization in Cloud Computing and Machine reference Model
ODP
Basics of VueJS
PPTX
Html5 semantics
PPTX
Web api
PPTX
Spring mvc
PPT
HTML & CSS Workshop Notes
PPTX
Restful web services ppt
PPT
Soap and Rest
PPTX
Php technical presentation
PPTX
Django Framework Overview forNon-Python Developers
PPTX
Advanced Web Technology using Django.pptx

More Related Content

PPTX
Introduction to Django
PDF
Django Tutorial | Django Web Development With Python | Django Training and Ce...
PPTX
Osgi
PPTX
Library Management System
ODP
An Introduction to Vuejs
PDF
Expressjs
PPTX
Master page in Asp.net
DOCX
Super marketbillingsystemproject
Introduction to Django
Django Tutorial | Django Web Development With Python | Django Training and Ce...
Osgi
Library Management System
An Introduction to Vuejs
Expressjs
Master page in Asp.net
Super marketbillingsystemproject

What's hot

PPTX
Basic Python Django
PPTX
Django Girls Tutorial
PPTX
Internship Presentation 2 Web Developer
PPTX
An introduction to Vue.js
PDF
Vue.js
ODP
Routing & Navigating Pages in Angular 2
PDF
Why Vue.js?
PPTX
Its time to React.js
PPT
Joomla
PDF
Wordpress CMS tutorial and guide manual
PDF
Understanding Sling Models in AEM
PPTX
Virtualization in Cloud Computing and Machine reference Model
ODP
Basics of VueJS
PPTX
Html5 semantics
PPTX
Web api
PPTX
Spring mvc
PPT
HTML & CSS Workshop Notes
PPTX
Restful web services ppt
PPT
Soap and Rest
PPTX
Php technical presentation
Basic Python Django
Django Girls Tutorial
Internship Presentation 2 Web Developer
An introduction to Vue.js
Vue.js
Routing & Navigating Pages in Angular 2
Why Vue.js?
Its time to React.js
Joomla
Wordpress CMS tutorial and guide manual
Understanding Sling Models in AEM
Virtualization in Cloud Computing and Machine reference Model
Basics of VueJS
Html5 semantics
Web api
Spring mvc
HTML & CSS Workshop Notes
Restful web services ppt
Soap and Rest
Php technical presentation

Similar to Django Workflow and Architecture

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

More from Andolasoft Inc

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

Recently uploaded

PDF
Olga Grom: Presale та комерційні моделі (UA)
PPTX
Project Management Tools for Faster, Smarter Execution
PDF
Step-by-Step Guide to Buying LinkedIn Accounts in 2026.pdf
PDF
Safe & Secure Ways to Buy Verified Paypal Accounts in 2025.pdf
PDF
how to Buy linkedin Accounts in 2026 .pdf
PDF
How to Safely Buy Twitter Accounts A Complete Guide in ....pdf
PDF
What You in 2026 Buy Twitter Accounts_.pdf
PDF
Best Platforms to Buy Verified Wise Accounts in the USA.pdf
PDF
Best 11 Places to Purchase Mature Twitter Accounts for Marketing.pdf
DOCX
Safe & Secure Ways to Buy Verified Paypal Accounts in 2025.docx
PDF
How to Buy Aged Facebook Accounts in 2026.pdf
PDF
Top 10 Websites to Buy Facebook Accounts Tone.pdf
PDF
ASD SCO Introduction December 2025 (1).pdf
PDF
How to Buy USA Facebook Accounts in 2026 (1).pdf
PDF
How to Buy USA Facebook Accounts in 2026 .pdf
PDF
J Hamilton - Pensions UK V1 27.11.2025 (1).pdf
PDF
Christopher Elwell Woburn, MA - An Experienced IT Executive
PDF
Equinox Gold - Corporate Presentation.pdf
PDF
LCP-Pension-Submisson-CDC-Superfund-December-2025.pdf
PDF
Dr. Alexander Everest - A Sustainability Strategist
Olga Grom: Presale та комерційні моделі (UA)
Project Management Tools for Faster, Smarter Execution
Step-by-Step Guide to Buying LinkedIn Accounts in 2026.pdf
Safe & Secure Ways to Buy Verified Paypal Accounts in 2025.pdf
how to Buy linkedin Accounts in 2026 .pdf
How to Safely Buy Twitter Accounts A Complete Guide in ....pdf
What You in 2026 Buy Twitter Accounts_.pdf
Best Platforms to Buy Verified Wise Accounts in the USA.pdf
Best 11 Places to Purchase Mature Twitter Accounts for Marketing.pdf
Safe & Secure Ways to Buy Verified Paypal Accounts in 2025.docx
How to Buy Aged Facebook Accounts in 2026.pdf
Top 10 Websites to Buy Facebook Accounts Tone.pdf
ASD SCO Introduction December 2025 (1).pdf
How to Buy USA Facebook Accounts in 2026 (1).pdf
How to Buy USA Facebook Accounts in 2026 .pdf
J Hamilton - Pensions UK V1 27.11.2025 (1).pdf
Christopher Elwell Woburn, MA - An Experienced IT Executive
Equinox Gold - Corporate Presentation.pdf
LCP-Pension-Submisson-CDC-Superfund-December-2025.pdf
Dr. Alexander Everest - A Sustainability Strategist

Django Workflow and Architecture

  • 2.
    Django Workflow andArchitectureWhat is Django?Django is a free and open source web application framework written in Python. A framework isnothing over a group of modules that create development easier. They're sorted along, andpermit you to make applications or websites from associate existing supply, rather than fromscratch.When you are building a website, you mostly would like the same set of components: how tohandle user authentication (signing up, signing in, sign language out), a management panel foryour 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 anumber of the overhead once you’re building a replacement web site and Django framework isone in all them.The official project web site describes Django as “a high-level Python net framework thatencourages fast development and clean, pragmatic style. It takes care of lot of effort of netdevelopment, 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 andDjango isn't any totally different.
  • 3.
    Django ArchitectureMVT isgenerally very similar to that of MVC which is a Model, View, and Controller. Thedistinction between MVC and MVT here is that Django itself will do the work done by thecontroller half within the MVC design. Django will do this work of the controller by victimizationtemplates. Precisely, the template file may be a mixture of hypertext markup language half andDjango example Language conjointly referred to as DTL.Django follows the MVT frameworkfor architectureM stands for ModelV stands for ViewT stands for Template
  • 4.
    Benefits of DjangoArchitectureThe Django Framework is predicated on this design and it really communicates between these 3elements without having to put in writing complicated code. That’s why Django is gainingquality.This design in Django has numerous blessings like:1. Rapid Development: Django design that separates in different components makes iteasy for multiple developers to work on different aspects of the same applicationsimultaneously. That's additionally one among the options of Django.2. Loosely Coupled: Django has totally different elements that need one another at boundelements of the application, at each instant, that will increase the safety of the generalwebsite. Because the model file can currently solely save on our server instead of savingon the webpage.3. Ease of Modification:This can be a crucial fact of development as there area unit totallydifferent elements in Django design. If there's a modification in numerous elements, wetend not to modify it in alternative elements. This can be really one among the specialoptions of Django, as here it provides us a way with more ability of our web site thanalternative frameworks.4. Security:Whereas building high-end internet applications, security becomes a reallycrucial facet to reflect on. Django understands this concern and provides its bestdefender to avoid wasting your efforts. Using click-jacking, cross-site scripting, SQLinjections Django builds a robust wall for the application’s safety. User authentication isadditionally a crucial feature to securely manage user accounts and passwords thatDjango provides.5. Scalable:Scalability can be understood as an ability of an application to work well whenthe 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 websitesvictimization Django embody Spotify, Netflix, YouTube,Mozilla, Quora, etc.Creating a New Project in DjangoTo start a new Django project, run the command below:django-admin startprojectmyprojectAfter we run the command above, it will generate the base folder structure for a Djangoproject.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 runmanagement commands related to our project. We will use it to run the developmentserver, 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 allthe time!● urls.py: this file is responsible for mapping the routes and paths in our project. Forexample, if you want to show something in the URL /about/, you have to map it herefirst.
  • 6.
    ● wsgi.py: thisfile is a simple gateway interface used for deployment.Now everything is st up and we can run the server using below commandpython manage.py runserverNow open the URL in a Web browser: http://127.0.0.1:8000 and you should see the successpage, which means the server is running correctly.Creating Django AppsDjango project contains many apps within it. An app can't run without a project. You can createapp by the following commanddjango-admin startapp articlesThis 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 firstexplore what each file does:● migrations/: here Django stores some files to keep track of the changes you create inthe 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 aretranslated 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 Webapplication.Now that we created our first app, let’s configure our project to use it. Open settings.py file andfind installed_apps block.settings.pyINSTALLED_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 theDjango project.Configuring DatabaseBy default Django project comes with sqlite3 database but you can customize it to use MySQLor 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.ConclusionIn this blog we have learned how the MVT pattern works and the structure of Djangoapplication along with the database configuration.

[8]ページ先頭

©2009-2025 Movatter.jp