SlideShare ist ein Scribd-Unternehmen logo
The model provides data from the database.
In Django, the data is delivered as an Object Relational Mapping
(ORM), which is a technique designed to make it easier to work with
databases.
The most common way to extract data from a database is SQL. One
problem with SQL is that you have to have a pretty good
understanding of the database structure to be able to work with it.
Django, with ORM, makes it easier to communicate with the database,
without having to write complex SQL statements.
The models are usually located in a file called models.py.
A template is a file where you describe how the result
should be represented.
Templates are often .html files, with HTML code describing
the layout of a web page, but it can also be in other file
formats to present other results, but we will concentrate on
.html files.
Django uses standard HTML to
describe the layout, but uses
Django tags to add logic:
<h1>My Homepage</h1>
<p>My name is {{ firstname
}}.</p>
The templates of an application is located in a folder
named templates.
Django also provides a way to
navigate around the different pages
in a website.
When a user requests a URL, Django
decides which view it will send it to.
This is done in a file called urls.py.
1 - Django receives the URL,
checks the urls.py file, and calls
the view that matches the URL.
2 - The view, located in views.py,
checks for relevant models.
3 - The models are imported
from the models.py file.
4 - The view then sends the data
to a specified template in
the template folder.
5 - The template contains HTML
and Django tags, and with the
data it returns finished HTML
content back to the browser.
Note: You must activate the
virtual environment every time
you open the command prompt to
work on your project.
Note: Now you have installed Django in your new project,
running in a virtual environment!
Navigate to where in the file system you
want to store the code (in the virtual
environment), and run this command in
the command prompt:
django-admin startproject myworld
Django creates a myworld folder on my
computer, with this content:
myworld
manage.py
myworld/
__init__.py
asgi.py
settings.py
urls.py
wsgi.py
Now that you have a Django
project, you can run it, and see
what it looks like in a browser.
Navigate to the /myworld folder
and execute this command in
the command prompt:
py manage.py runserver
Django views are Python functions
that takes http requests and returns
http response, like HTML documents.
A web page that uses Django is full of
views with different tasks and
missions.
Views are usually put in a file
called views.py located on your app's
folder.
When we created the Django project, we got an empty SQLite
database. It was created in the myworld root folder.
We will use this database in this session.
To add some HTML around the
values, we will create a template
for the application.
All templates must be located in
the templates folder off your app,
if you have not already created
a templates folder, do it now.
django part-1
django part-1
django part-1
django part-1
django part-1
django part-1
django part-1
django part-1
django part-1
django part-1
django part-1
django part-1
django part-1
django part-1
django part-1
django part-1
django part-1
django part-1
django part-1
django part-1
django part-1
django part-1
django part-1
django part-1
django part-1
django part-1

Weitere ähnliche Inhalte

Was ist angesagt?

Introduction to django
Introduction to djangoIntroduction to django
Introduction to django
Ilian Iliev
 
Django for Beginners
Django for BeginnersDjango for Beginners
Django for Beginners
Jason Davies
 
Introduction to Django
Introduction to DjangoIntroduction to Django
Introduction to Django
James Casey
 
Angular
AngularAngular
Angular
Lilia Sfaxi
 
Introduction to django framework
Introduction to django frameworkIntroduction to django framework
Introduction to django framework
Knoldus Inc.
 
Angular
AngularAngular
Django, What is it, Why is it cool?
Django, What is it, Why is it cool?Django, What is it, Why is it cool?
Django, What is it, Why is it cool?
Tom Brander
 
Django Framework Overview forNon-Python Developers
Django Framework Overview forNon-Python DevelopersDjango Framework Overview forNon-Python Developers
Django Framework Overview forNon-Python Developers
Rosario Renga
 
An introduction to bootstrap
An introduction to bootstrapAn introduction to bootstrap
An introduction to bootstrap
Mind IT Systems
 
Bootstrap 5 basic
Bootstrap 5 basicBootstrap 5 basic
Bootstrap 5 basic
Jubair Ahmed Junjun
 
Django Introduction & Tutorial
Django Introduction & TutorialDjango Introduction & Tutorial
Django Introduction & Tutorial
之宇 趙
 
FRONT-END WEB DEVELOPMENT WITH REACTJS
FRONT-END WEB DEVELOPMENT WITH REACTJSFRONT-END WEB DEVELOPMENT WITH REACTJS
FRONT-END WEB DEVELOPMENT WITH REACTJS
Tran Phong Phu
 
Django by rj
Django by rjDjango by rj
Web Development
Web DevelopmentWeb Development
Web Development
SabahtHussein
 
Aula C#: Listando Registros do MySQL no ListView
Aula C#: Listando Registros do MySQL no ListViewAula C#: Listando Registros do MySQL no ListView
Aula C#: Listando Registros do MySQL no ListView
Tiago Antônio da Silva
 
.Net Framework & Languages Supported by .Net Frmaework
.Net Framework & Languages Supported by .Net Frmaework.Net Framework & Languages Supported by .Net Frmaework
.Net Framework & Languages Supported by .Net Frmaework
Pranil Dukare
 
JavaFX ALA ppt.pptx
JavaFX ALA ppt.pptxJavaFX ALA ppt.pptx
JavaFX ALA ppt.pptx
BhagyasriPatel1
 
PHP.ppt
PHP.pptPHP.ppt
Codeigniter
CodeigniterCodeigniter
Codeigniter
minhrau111
 
Asp.net mvc basic introduction
Asp.net mvc basic introductionAsp.net mvc basic introduction
Asp.net mvc basic introduction
Bhagath Gopinath
 

Was ist angesagt? (20)

Introduction to django
Introduction to djangoIntroduction to django
Introduction to django
 
Django for Beginners
Django for BeginnersDjango for Beginners
Django for Beginners
 
Introduction to Django
Introduction to DjangoIntroduction to Django
Introduction to Django
 
Angular
AngularAngular
Angular
 
Introduction to django framework
Introduction to django frameworkIntroduction to django framework
Introduction to django framework
 
Angular
AngularAngular
Angular
 
Django, What is it, Why is it cool?
Django, What is it, Why is it cool?Django, What is it, Why is it cool?
Django, What is it, Why is it cool?
 
Django Framework Overview forNon-Python Developers
Django Framework Overview forNon-Python DevelopersDjango Framework Overview forNon-Python Developers
Django Framework Overview forNon-Python Developers
 
An introduction to bootstrap
An introduction to bootstrapAn introduction to bootstrap
An introduction to bootstrap
 
Bootstrap 5 basic
Bootstrap 5 basicBootstrap 5 basic
Bootstrap 5 basic
 
Django Introduction & Tutorial
Django Introduction & TutorialDjango Introduction & Tutorial
Django Introduction & Tutorial
 
FRONT-END WEB DEVELOPMENT WITH REACTJS
FRONT-END WEB DEVELOPMENT WITH REACTJSFRONT-END WEB DEVELOPMENT WITH REACTJS
FRONT-END WEB DEVELOPMENT WITH REACTJS
 
Django by rj
Django by rjDjango by rj
Django by rj
 
Web Development
Web DevelopmentWeb Development
Web Development
 
Aula C#: Listando Registros do MySQL no ListView
Aula C#: Listando Registros do MySQL no ListViewAula C#: Listando Registros do MySQL no ListView
Aula C#: Listando Registros do MySQL no ListView
 
.Net Framework & Languages Supported by .Net Frmaework
.Net Framework & Languages Supported by .Net Frmaework.Net Framework & Languages Supported by .Net Frmaework
.Net Framework & Languages Supported by .Net Frmaework
 
JavaFX ALA ppt.pptx
JavaFX ALA ppt.pptxJavaFX ALA ppt.pptx
JavaFX ALA ppt.pptx
 
PHP.ppt
PHP.pptPHP.ppt
PHP.ppt
 
Codeigniter
CodeigniterCodeigniter
Codeigniter
 
Asp.net mvc basic introduction
Asp.net mvc basic introductionAsp.net mvc basic introduction
Asp.net mvc basic introduction
 

Ähnlich wie django part-1

Company Visitor Management System Report.docx
Company Visitor Management System Report.docxCompany Visitor Management System Report.docx
Company Visitor Management System Report.docx
fantabulous2024
 
Django Introdcution
Django IntrodcutionDjango Introdcution
Django Introdcution
Nagi Annapureddy
 
Database Website on Django
Database Website on DjangoDatabase Website on Django
Database Website on Django
HamdaAnees
 
Rapid web application development using django - Part (1)
Rapid web application development using django - Part (1)Rapid web application development using django - Part (1)
Rapid web application development using django - Part (1)
Nishant Soni
 
Django tutorial
Django tutorialDjango tutorial
Django tutorial
Ksd Che
 
Basic Python Django
Basic Python DjangoBasic Python Django
Basic Python Django
Kaleem Ullah Mangrio
 
Web development with django - Basics Presentation
Web development with django - Basics PresentationWeb development with django - Basics Presentation
Web development with django - Basics Presentation
Shrinath Shenoy
 
Django Workflow and Architecture
Django Workflow and ArchitectureDjango Workflow and Architecture
Django Workflow and Architecture
Andolasoft Inc
 
Django interview Questions| Edureka
Django interview  Questions| EdurekaDjango interview  Questions| Edureka
Django interview Questions| Edureka
Edureka!
 
Django and Mongoengine
Django and MongoengineDjango and Mongoengine
Django and Mongoengine
austinpublic
 
0506-django-web-framework-for-python.pdf
0506-django-web-framework-for-python.pdf0506-django-web-framework-for-python.pdf
0506-django-web-framework-for-python.pdf
radhianiedjan1
 
Django & React
Django & ReactDjango & React
Django & React
Osman SELVİ
 
Django 1.10.3 Getting started
Django 1.10.3 Getting startedDjango 1.10.3 Getting started
Django 1.10.3 Getting started
MoniaJ
 
Django
DjangoDjango
Django
Ksd Che
 
Learning PHP for Drupal Theming, DC Chicago 2009
Learning PHP for Drupal Theming, DC Chicago 2009Learning PHP for Drupal Theming, DC Chicago 2009
Learning PHP for Drupal Theming, DC Chicago 2009
Emma Jane Hogbin Westby
 
Pluggable patterns
Pluggable patternsPluggable patterns
Pluggable patterns
Corey Oordt
 
Sahil_18118_IOT-ppt.pptx
Sahil_18118_IOT-ppt.pptxSahil_18118_IOT-ppt.pptx
Sahil_18118_IOT-ppt.pptx
BasicProgrammingknow
 
Introduction to django
Introduction to djangoIntroduction to django
Introduction to django
Vlad Voskoboynik
 
Akash rajguru project report sem v
Akash rajguru project report sem vAkash rajguru project report sem v
Akash rajguru project report sem v
Akash Rajguru
 
Django - basics
Django - basicsDjango - basics
Django - basics
University of Technology
 

Ähnlich wie django part-1 (20)

Company Visitor Management System Report.docx
Company Visitor Management System Report.docxCompany Visitor Management System Report.docx
Company Visitor Management System Report.docx
 
Django Introdcution
Django IntrodcutionDjango Introdcution
Django Introdcution
 
Database Website on Django
Database Website on DjangoDatabase Website on Django
Database Website on Django
 
Rapid web application development using django - Part (1)
Rapid web application development using django - Part (1)Rapid web application development using django - Part (1)
Rapid web application development using django - Part (1)
 
Django tutorial
Django tutorialDjango tutorial
Django tutorial
 
Basic Python Django
Basic Python DjangoBasic Python Django
Basic Python Django
 
Web development with django - Basics Presentation
Web development with django - Basics PresentationWeb development with django - Basics Presentation
Web development with django - Basics Presentation
 
Django Workflow and Architecture
Django Workflow and ArchitectureDjango Workflow and Architecture
Django Workflow and Architecture
 
Django interview Questions| Edureka
Django interview  Questions| EdurekaDjango interview  Questions| Edureka
Django interview Questions| Edureka
 
Django and Mongoengine
Django and MongoengineDjango and Mongoengine
Django and Mongoengine
 
0506-django-web-framework-for-python.pdf
0506-django-web-framework-for-python.pdf0506-django-web-framework-for-python.pdf
0506-django-web-framework-for-python.pdf
 
Django & React
Django & ReactDjango & React
Django & React
 
Django 1.10.3 Getting started
Django 1.10.3 Getting startedDjango 1.10.3 Getting started
Django 1.10.3 Getting started
 
Django
DjangoDjango
Django
 
Learning PHP for Drupal Theming, DC Chicago 2009
Learning PHP for Drupal Theming, DC Chicago 2009Learning PHP for Drupal Theming, DC Chicago 2009
Learning PHP for Drupal Theming, DC Chicago 2009
 
Pluggable patterns
Pluggable patternsPluggable patterns
Pluggable patterns
 
Sahil_18118_IOT-ppt.pptx
Sahil_18118_IOT-ppt.pptxSahil_18118_IOT-ppt.pptx
Sahil_18118_IOT-ppt.pptx
 
Introduction to django
Introduction to djangoIntroduction to django
Introduction to django
 
Akash rajguru project report sem v
Akash rajguru project report sem vAkash rajguru project report sem v
Akash rajguru project report sem v
 
Django - basics
Django - basicsDjango - basics
Django - basics
 

Kürzlich hochgeladen

Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Akanksha trivedi rama nursing college kanpur.
 
How to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 InventoryHow to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 Inventory
Celine George
 
How to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRMHow to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRM
Celine George
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
Priyankaranawat4
 
Wound healing PPT
Wound healing PPTWound healing PPT
Wound healing PPT
Jyoti Chand
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
Academy of Science of South Africa
 
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptxPrésentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
siemaillard
 
Chapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptxChapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptx
Denish Jangid
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
heathfieldcps1
 
Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
amberjdewit93
 
Cognitive Development Adolescence Psychology
Cognitive Development Adolescence PsychologyCognitive Development Adolescence Psychology
Cognitive Development Adolescence Psychology
paigestewart1632
 
MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
Colégio Santa Teresinha
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
mulvey2
 
How to deliver Powerpoint Presentations.pptx
How to deliver Powerpoint  Presentations.pptxHow to deliver Powerpoint  Presentations.pptx
How to deliver Powerpoint Presentations.pptx
HajraNaeem15
 
How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17
Celine George
 
BBR 2024 Summer Sessions Interview Training
BBR  2024 Summer Sessions Interview TrainingBBR  2024 Summer Sessions Interview Training
BBR 2024 Summer Sessions Interview Training
Katrina Pritchard
 
Leveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit InnovationLeveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit Innovation
TechSoup
 
Life upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for studentLife upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for student
NgcHiNguyn25
 
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UPLAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
RAHUL
 
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptxNEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
iammrhaywood
 

Kürzlich hochgeladen (20)

Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
 
How to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 InventoryHow to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 Inventory
 
How to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRMHow to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRM
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
 
Wound healing PPT
Wound healing PPTWound healing PPT
Wound healing PPT
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
 
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptxPrésentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
 
Chapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptxChapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptx
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
 
Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
 
Cognitive Development Adolescence Psychology
Cognitive Development Adolescence PsychologyCognitive Development Adolescence Psychology
Cognitive Development Adolescence Psychology
 
MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
 
How to deliver Powerpoint Presentations.pptx
How to deliver Powerpoint  Presentations.pptxHow to deliver Powerpoint  Presentations.pptx
How to deliver Powerpoint Presentations.pptx
 
How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17
 
BBR 2024 Summer Sessions Interview Training
BBR  2024 Summer Sessions Interview TrainingBBR  2024 Summer Sessions Interview Training
BBR 2024 Summer Sessions Interview Training
 
Leveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit InnovationLeveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit Innovation
 
Life upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for studentLife upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for student
 
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UPLAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
 
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptxNEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
 

django part-1

  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7. The model provides data from the database. In Django, the data is delivered as an Object Relational Mapping (ORM), which is a technique designed to make it easier to work with databases. The most common way to extract data from a database is SQL. One problem with SQL is that you have to have a pretty good understanding of the database structure to be able to work with it. Django, with ORM, makes it easier to communicate with the database, without having to write complex SQL statements. The models are usually located in a file called models.py.
  • 8.
  • 9. A template is a file where you describe how the result should be represented. Templates are often .html files, with HTML code describing the layout of a web page, but it can also be in other file formats to present other results, but we will concentrate on .html files. Django uses standard HTML to describe the layout, but uses Django tags to add logic: <h1>My Homepage</h1> <p>My name is {{ firstname }}.</p> The templates of an application is located in a folder named templates.
  • 10. Django also provides a way to navigate around the different pages in a website. When a user requests a URL, Django decides which view it will send it to. This is done in a file called urls.py.
  • 11. 1 - Django receives the URL, checks the urls.py file, and calls the view that matches the URL. 2 - The view, located in views.py, checks for relevant models. 3 - The models are imported from the models.py file. 4 - The view then sends the data to a specified template in the template folder. 5 - The template contains HTML and Django tags, and with the data it returns finished HTML content back to the browser.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17. Note: You must activate the virtual environment every time you open the command prompt to work on your project.
  • 18. Note: Now you have installed Django in your new project, running in a virtual environment!
  • 19.
  • 20.
  • 21. Navigate to where in the file system you want to store the code (in the virtual environment), and run this command in the command prompt: django-admin startproject myworld
  • 22. Django creates a myworld folder on my computer, with this content: myworld manage.py myworld/ __init__.py asgi.py settings.py urls.py wsgi.py
  • 23. Now that you have a Django project, you can run it, and see what it looks like in a browser. Navigate to the /myworld folder and execute this command in the command prompt: py manage.py runserver
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30. Django views are Python functions that takes http requests and returns http response, like HTML documents. A web page that uses Django is full of views with different tasks and missions. Views are usually put in a file called views.py located on your app's folder.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
  • 38.
  • 39.
  • 40.
  • 41.
  • 42. When we created the Django project, we got an empty SQLite database. It was created in the myworld root folder. We will use this database in this session.
  • 43.
  • 44.
  • 45.
  • 46.
  • 47.
  • 48.
  • 49.
  • 50.
  • 51.
  • 52.
  • 53.
  • 54.
  • 55. To add some HTML around the values, we will create a template for the application. All templates must be located in the templates folder off your app, if you have not already created a templates folder, do it now.