SlideShare une entreprise Scribd logo
1  sur  26
Télécharger pour lire hors ligne
Django
Framework
The web framework for
perfectionists with deadlines
Rosario Renga rosario.renga@ericsson.com
1. What is Django
2. What is Python
3. Django’s Capabilities
a. All-in-One and Ready to Use
b. Modularity
c. Pattern: MTV and DRY
d. Deployment strategies
4. Useful Links
Summary
› Django is a high-level Python Web framework.
› Rapid development and clean, pragmatic design.
› Focus on writing your app without needing to reinvent the
wheel.
› It’s free and open source.
From https://www.djangoproject.com/
What is Django ?
 Instagram: http://instagram.com/
 Pinterest: https://www.pinterest.com/
 The Washington
Post:http://www.washingtonpost.com/
 Mozilla’s blog: http://blog.mozilla.org/webdev/
 My blog!  http://blog.itsmurfs.it/
Who use Django ?
 Enterprise Point Of View
 Free and Open-source.
 Thousand of free reusable apps already pluggable into
one’s project.
 Compatible with all the main databases.
 Compatible with all the JS and CSS Frameworks.
Why Django ?
 Developer Point Of View
 Use and learn a new language: Python.
 DB Management and ORM built-in.
 Rich documentation.
 Active community.
 Modular architecture.
 DRY Principle (Don’t Repeat Yourself).
 MVC Pattern reinterpreted in MTV.
Why DJAngo ?
 Questions?
What is Django ?
 Python is an interpreted, interactive, object-oriented
programming language.
 Platform indipendent.
 Combines remarkable power with very clear syntax.
 Very rich community and many libraries and frameworks.
 It’s free and open source.
What is python ?
 Open google and search for: most used programming
languages 2014
Who use Python?
Syntax:
 No “;” and “{ }”
 Blocks starts with “:” and are identified by Indentation
 No statically typed. You don’t need to declare any variable
 You can mix object-oriented and imperative programming.
What is python ?
What is python ?
What is python ?
 List:
 Declared using “[ ]”
 Access using index
 Mutable
 Tuple:
 Declared using “( )”
 Access using index
 Immutable
 Dictionary:
 Declared using “ { } “
 Access using keyword
Data Structure:
What is python ?
 Easy to install:
 Download and Install Python:
https://www.python.org/downloads/
 Install pip ( https://bootstrap.pypa.io/get-pip.py ):
 Install Django
Django’s Capabilities
python get-pip.py
pip install django
› Don’t worry there is an IDE that can do these dirties things for you:
› Or you can use Eclipse with pyDev (http://pydev.org/ )
› Ready to use:
 To start a new project just type in a cmd:
 Then starts a new app with:
Django’s Capabilities
django-admin.py startproject mysite
python manage.py startapp polls
 Let’s look at the structure the commands have created:
Django’s Capabilities
Project root
Project package
App package
Project
configurations
files
Application files
All in one:
› With these two commands we have:
 Created the project structure
 Installed the ORM
 Installed a development server
 Installed and configured an SQLite database
 Installed the admin interface
 Installed a ready to use unit-test environement
Django’s Capabilities
– Create the database tables based on the models found in the installed apps.
– Create the database for the authentication system included in django
– Create a superuser account for the authentication system
– Set up a system for propagating change makes to the models into the database
schema
python manage.py migrate
 Modularity:
 You can take existing Python packages or Django apps and compose
them into your own web project. You only need to write the parts that
make your project unique.
 Built-in reusable apps:
 django.contrib.admin – The admin site.
 django.contrib.auth – An authentication system.
 django.contrib.contenttypes – A framework for content types.
 django.contrib.sessions – A session framework.
 django.contrib.messages – A messaging framework.
 django.contrib.staticfiles – A framework for managing static files.
Django’s Capabilities
 Third party reusable apps:
 Django REST framework is a framework to build REST APIs.
 Celery is the standard to manage asynchronous, distributed job queues.
 Django mailer provides a backend for sending email
 django-allauth allows for both local and social authentication
 django-grappelli A jazzy skin for the Django Admin-Interface
 django-tables2 An app for creating HTML tables
 django-dajax Easy to use library to create asynchronous presentation logic with django
 And much more….
Django’s Capabilities
› All these apps can be installed simply typing:
pip install <app_name>
 How to write reusable apps:
 The app we have just created is already reusable!
 Just copy and paste it to another project and link it in the settings.py
 Of course there is a more complete way to package an app:
 https://docs.djangoproject.com/en/1.7/intro/reusable-
apps/#packaging-your-app
 How to find more apps:
 Check https://www.djangopackages.com/ a directory of reusable
apps, sites, tools, and more for your Django projects
 Ask to the community:
https://groups.google.com/forum/#!forum/django-it
 Try to search them: www.google.com
Django’s Capabilities
DRY (Don’t Repeat Yourself)
The DRY principal was one of the fundamental
concepts that Django was designed around.
The DRY principal is all about keeping code simple and
non repeating. This allows developers to reuse code
they wrote for one project in another project.
To help developers adhere to the DRY principle,
Django forces users to use the MVC by initially creating
a standard project structure.
Django’s Capabilities
A different interpretation of the MVC:
MTV: Model View Template
In django interpretation of MVC, the “view” describes the
data that gets presented to the user. It’s not
necessarily how the data looks, but which data is presented.
The view describes which data you see, not how you see it.
Furthermore, it’s sensible to separate content from
presentation – which is where templates come in. In Django,
a “view” describes which data is presented, but a view
normally delegates to a template, which describes how the
data is presented.
Django’s Capabilities
Django Framework Overview forNon-Python Developers
 Deployment Strategies:
 In the cloud:
 Heroku
 Google Appengine
 On a remote machine:
 NGINX + uWSGI or Gunicorn
 Apache + mod_wsgi
Django’s Capabilities
 Official site: https://www.djangoproject.com/
 Official google groups:
https://groups.google.com/forum/#!forum/django-users
 Italian community: https://groups.google.com/forum/#!forum/django-it
 Snippets of reusable code: https://djangosnippets.org/
 Collection of useful links: http://www.fullstackpython.com/django.html
Useful links
› Learning sites:
– https://docs.djangoproject.com/en/1.7/intro/
– http://www.tangowithdjango.com/
– http://tutorial.djangogirls.org/en/index.html
– http://effectivedjango.com/tutorial/
– http://www.djangobook.com/en/2.0/index.html
– http://stacktrace.it/site_media/luambo/uploads/2009/09/14/Copia_visione_Django.pdf
 Questions?
Thanks.

Contenu connexe

Tendances

Introduction to Django
Introduction to DjangoIntroduction to Django
Introduction to DjangoKnoldus Inc.
 
Introduction to django framework
Introduction to django frameworkIntroduction to django framework
Introduction to django frameworkKnoldus Inc.
 
Intro to Web Development Using Python and Django
Intro to Web Development Using Python and DjangoIntro to Web Development Using Python and Django
Intro to Web Development Using Python and DjangoChariza Pladin
 
Django Architecture Introduction
Django Architecture IntroductionDjango Architecture Introduction
Django Architecture IntroductionHaiqi Chen
 
Django Framework and Application Structure
Django Framework and Application StructureDjango Framework and Application Structure
Django Framework and Application StructureSEONGTAEK OH
 
A Basic Django Introduction
A Basic Django IntroductionA Basic Django Introduction
A Basic Django IntroductionGanga Ram
 
Python Django tutorial | Getting Started With Django | Web Development With D...
Python Django tutorial | Getting Started With Django | Web Development With D...Python Django tutorial | Getting Started With Django | Web Development With D...
Python Django tutorial | Getting Started With Django | Web Development With D...Edureka!
 
Web Development with Python and Django
Web Development with Python and DjangoWeb Development with Python and Django
Web Development with Python and DjangoMichael Pirnat
 
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
 
The Django Web Application Framework 2
The Django Web Application Framework 2The Django Web Application Framework 2
The Django Web Application Framework 2fishwarter
 
Angular 8
Angular 8 Angular 8
Angular 8 Sunil OS
 
Introduction Django
Introduction DjangoIntroduction Django
Introduction DjangoWade Austin
 
Introduction to Django
Introduction to DjangoIntroduction to Django
Introduction to DjangoAhmed Salama
 
Django Tutorial | Django Web Development With Python | Django Training and Ce...
Django Tutorial | Django Web Development With Python | Django Training and Ce...Django Tutorial | Django Web Development With Python | Django Training and Ce...
Django Tutorial | Django Web Development With Python | Django Training and Ce...Edureka!
 
Django Interview Questions and Answers
Django Interview Questions and AnswersDjango Interview Questions and Answers
Django Interview Questions and AnswersPython Devloper
 
Django interview Questions| Edureka
Django interview  Questions| EdurekaDjango interview  Questions| Edureka
Django interview Questions| EdurekaEdureka!
 

Tendances (20)

Introduction to Django
Introduction to DjangoIntroduction to Django
Introduction to Django
 
Introduction to django framework
Introduction to django frameworkIntroduction to django framework
Introduction to django framework
 
Intro to Web Development Using Python and Django
Intro to Web Development Using Python and DjangoIntro to Web Development Using Python and Django
Intro to Web Development Using Python and Django
 
Django by rj
Django by rjDjango by rj
Django by rj
 
Django Architecture Introduction
Django Architecture IntroductionDjango Architecture Introduction
Django Architecture Introduction
 
Django Framework and Application Structure
Django Framework and Application StructureDjango Framework and Application Structure
Django Framework and Application Structure
 
A Basic Django Introduction
A Basic Django IntroductionA Basic Django Introduction
A Basic Django Introduction
 
Python Django tutorial | Getting Started With Django | Web Development With D...
Python Django tutorial | Getting Started With Django | Web Development With D...Python Django tutorial | Getting Started With Django | Web Development With D...
Python Django tutorial | Getting Started With Django | Web Development With D...
 
Web Development with Python and Django
Web Development with Python and DjangoWeb Development with Python and Django
Web Development with Python and Django
 
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?
 
The Django Web Application Framework 2
The Django Web Application Framework 2The Django Web Application Framework 2
The Django Web Application Framework 2
 
Angular 8
Angular 8 Angular 8
Angular 8
 
Introduction Django
Introduction DjangoIntroduction Django
Introduction Django
 
Introduction to Django
Introduction to DjangoIntroduction to Django
Introduction to Django
 
django
djangodjango
django
 
Django Tutorial | Django Web Development With Python | Django Training and Ce...
Django Tutorial | Django Web Development With Python | Django Training and Ce...Django Tutorial | Django Web Development With Python | Django Training and Ce...
Django Tutorial | Django Web Development With Python | Django Training and Ce...
 
Django Interview Questions and Answers
Django Interview Questions and AnswersDjango Interview Questions and Answers
Django Interview Questions and Answers
 
Django
DjangoDjango
Django
 
Flask – Python
Flask – PythonFlask – Python
Flask – Python
 
Django interview Questions| Edureka
Django interview  Questions| EdurekaDjango interview  Questions| Edureka
Django interview Questions| Edureka
 

En vedette

A gentle intro to the Django Framework
A gentle intro to the Django FrameworkA gentle intro to the Django Framework
A gentle intro to the Django FrameworkRicardo Soares
 
* DJANGO - The Python Framework - Low Kian Seong, Developer
    * DJANGO - The Python Framework - Low Kian Seong, Developer    * DJANGO - The Python Framework - Low Kian Seong, Developer
* DJANGO - The Python Framework - Low Kian Seong, DeveloperLinuxmalaysia Malaysia
 
Web application development with Django framework
Web application development with Django frameworkWeb application development with Django framework
Web application development with Django frameworkflapiello
 
Introduction to Django REST Framework, an easy way to build REST framework in...
Introduction to Django REST Framework, an easy way to build REST framework in...Introduction to Django REST Framework, an easy way to build REST framework in...
Introduction to Django REST Framework, an easy way to build REST framework in...Zhe Li
 
Making Django and NoSQL Play Nice
Making Django and NoSQL Play NiceMaking Django and NoSQL Play Nice
Making Django and NoSQL Play NiceAlex Gaynor
 
Desenvolvimento web simples com Python e DJango
Desenvolvimento web simples com Python e DJangoDesenvolvimento web simples com Python e DJango
Desenvolvimento web simples com Python e DJangoRafael Nunes
 
Python e Django na Globo.com
Python e Django na Globo.comPython e Django na Globo.com
Python e Django na Globo.comricobl
 

En vedette (9)

Django - basics
Django - basicsDjango - basics
Django - basics
 
A gentle intro to the Django Framework
A gentle intro to the Django FrameworkA gentle intro to the Django Framework
A gentle intro to the Django Framework
 
* DJANGO - The Python Framework - Low Kian Seong, Developer
    * DJANGO - The Python Framework - Low Kian Seong, Developer    * DJANGO - The Python Framework - Low Kian Seong, Developer
* DJANGO - The Python Framework - Low Kian Seong, Developer
 
Web application development with Django framework
Web application development with Django frameworkWeb application development with Django framework
Web application development with Django framework
 
Introduction to Django REST Framework, an easy way to build REST framework in...
Introduction to Django REST Framework, an easy way to build REST framework in...Introduction to Django REST Framework, an easy way to build REST framework in...
Introduction to Django REST Framework, an easy way to build REST framework in...
 
Making Django and NoSQL Play Nice
Making Django and NoSQL Play NiceMaking Django and NoSQL Play Nice
Making Django and NoSQL Play Nice
 
Why Django for Web Development
Why Django for Web DevelopmentWhy Django for Web Development
Why Django for Web Development
 
Desenvolvimento web simples com Python e DJango
Desenvolvimento web simples com Python e DJangoDesenvolvimento web simples com Python e DJango
Desenvolvimento web simples com Python e DJango
 
Python e Django na Globo.com
Python e Django na Globo.comPython e Django na Globo.com
Python e Django na Globo.com
 

Similaire à Django Framework Overview forNon-Python Developers

Django Article V0
Django Article V0Django Article V0
Django Article V0Udi Bauman
 
Hiring Django Developers for Success.pdf
Hiring Django Developers for Success.pdfHiring Django Developers for Success.pdf
Hiring Django Developers for Success.pdfAIS Technolabs Pvt Ltd
 
Ramya devi R internet of things
Ramya devi R internet of thingsRamya devi R internet of things
Ramya devi R internet of thingsPriyadharshiniVS
 
بررسی چارچوب جنگو
بررسی چارچوب جنگوبررسی چارچوب جنگو
بررسی چارچوب جنگوrailsbootcamp
 
Company Visitor Management System Report.docx
Company Visitor Management System Report.docxCompany Visitor Management System Report.docx
Company Visitor Management System Report.docxfantabulous2024
 
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
 
Web Development in Django
Web Development in DjangoWeb Development in Django
Web Development in DjangoLakshman Prasad
 
Why Django is The Go-To Framework For Python.pdf
Why Django is The Go-To Framework For Python.pdfWhy Django is The Go-To Framework For Python.pdf
Why Django is The Go-To Framework For Python.pdfMindfire LLC
 
Akash rajguru project report sem v
Akash rajguru project report sem vAkash rajguru project report sem v
Akash rajguru project report sem vAkash Rajguru
 
Introduction to Gradio library in python.pptx
Introduction to Gradio library in python.pptxIntroduction to Gradio library in python.pptx
Introduction to Gradio library in python.pptxvahid67ebrahimian
 

Similaire à Django Framework Overview forNon-Python Developers (20)

Django framework
Django frameworkDjango framework
Django framework
 
Django
Django Django
Django
 
Django Article V0
Django Article V0Django Article V0
Django Article V0
 
Django
DjangoDjango
Django
 
Hiring Django Developers for Success.pdf
Hiring Django Developers for Success.pdfHiring Django Developers for Success.pdf
Hiring Django Developers for Success.pdf
 
Ramya devi R internet of things
Ramya devi R internet of thingsRamya devi R internet of things
Ramya devi R internet of things
 
بررسی چارچوب جنگو
بررسی چارچوب جنگوبررسی چارچوب جنگو
بررسی چارچوب جنگو
 
Basic Python Django
Basic Python DjangoBasic Python Django
Basic Python Django
 
Django Introdcution
Django IntrodcutionDjango Introdcution
Django Introdcution
 
Company Visitor Management System Report.docx
Company Visitor Management System Report.docxCompany Visitor Management System Report.docx
Company Visitor Management System Report.docx
 
React django
React djangoReact django
React 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)
 
Web Development in Django
Web Development in DjangoWeb Development in Django
Web Development in Django
 
Why Django is The Go-To Framework For Python.pdf
Why Django is The Go-To Framework For Python.pdfWhy Django is The Go-To Framework For Python.pdf
Why Django is The Go-To Framework For Python.pdf
 
Akash rajguru project report sem v
Akash rajguru project report sem vAkash rajguru project report sem v
Akash rajguru project report sem v
 
Django
DjangoDjango
Django
 
Introduction to Gradio library in python.pptx
Introduction to Gradio library in python.pptxIntroduction to Gradio library in python.pptx
Introduction to Gradio library in python.pptx
 
django
djangodjango
django
 
Django
DjangoDjango
Django
 
Django
DjangoDjango
Django
 

Dernier

3 Pitfalls Everyone Should Avoid with Cloud Data
3 Pitfalls Everyone Should Avoid with Cloud Data3 Pitfalls Everyone Should Avoid with Cloud Data
3 Pitfalls Everyone Should Avoid with Cloud DataEric D. Schabell
 
Automation Ops Series: Session 2 - Governance for UiPath projects
Automation Ops Series: Session 2 - Governance for UiPath projectsAutomation Ops Series: Session 2 - Governance for UiPath projects
Automation Ops Series: Session 2 - Governance for UiPath projectsDianaGray10
 
March Patch Tuesday
March Patch TuesdayMarch Patch Tuesday
March Patch TuesdayIvanti
 
SIM INFORMATION SYSTEM: REVOLUTIONIZING DATA MANAGEMENT
SIM INFORMATION SYSTEM: REVOLUTIONIZING DATA MANAGEMENTSIM INFORMATION SYSTEM: REVOLUTIONIZING DATA MANAGEMENT
SIM INFORMATION SYSTEM: REVOLUTIONIZING DATA MANAGEMENTxtailishbaloch
 
Novo Nordisk's journey in developing an open-source application on Neo4j
Novo Nordisk's journey in developing an open-source application on Neo4jNovo Nordisk's journey in developing an open-source application on Neo4j
Novo Nordisk's journey in developing an open-source application on Neo4jNeo4j
 
TrustArc Webinar - How to Live in a Post Third-Party Cookie World
TrustArc Webinar - How to Live in a Post Third-Party Cookie WorldTrustArc Webinar - How to Live in a Post Third-Party Cookie World
TrustArc Webinar - How to Live in a Post Third-Party Cookie WorldTrustArc
 
The Importance of Indoor Air Quality (English)
The Importance of Indoor Air Quality (English)The Importance of Indoor Air Quality (English)
The Importance of Indoor Air Quality (English)IES VE
 
Design and Modeling for MySQL SCALE 21X Pasadena, CA Mar 2024
Design and Modeling for MySQL SCALE 21X Pasadena, CA Mar 2024Design and Modeling for MySQL SCALE 21X Pasadena, CA Mar 2024
Design and Modeling for MySQL SCALE 21X Pasadena, CA Mar 2024Alkin Tezuysal
 
Top 10 Squarespace Development Companies
Top 10 Squarespace Development CompaniesTop 10 Squarespace Development Companies
Top 10 Squarespace Development CompaniesTopCSSGallery
 
2024.03.12 Cost drivers of cultivated meat production.pdf
2024.03.12 Cost drivers of cultivated meat production.pdf2024.03.12 Cost drivers of cultivated meat production.pdf
2024.03.12 Cost drivers of cultivated meat production.pdfThe Good Food Institute
 
Where developers are challenged, what developers want and where DevEx is going
Where developers are challenged, what developers want and where DevEx is goingWhere developers are challenged, what developers want and where DevEx is going
Where developers are challenged, what developers want and where DevEx is goingFrancesco Corti
 
The Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightThe Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightSafe Software
 
Stobox 4: Revolutionizing Investment in Real-World Assets Through Tokenization
Stobox 4: Revolutionizing Investment in Real-World Assets Through TokenizationStobox 4: Revolutionizing Investment in Real-World Assets Through Tokenization
Stobox 4: Revolutionizing Investment in Real-World Assets Through TokenizationStobox
 
My key hands-on projects in Quantum, and QAI
My key hands-on projects in Quantum, and QAIMy key hands-on projects in Quantum, and QAI
My key hands-on projects in Quantum, and QAIVijayananda Mohire
 
Scenario Library et REX Discover industry- and role- based scenarios
Scenario Library et REX Discover industry- and role- based scenariosScenario Library et REX Discover industry- and role- based scenarios
Scenario Library et REX Discover industry- and role- based scenariosErol GIRAUDY
 
LF Energy Webinar - Unveiling OpenEEMeter 4.0
LF Energy Webinar - Unveiling OpenEEMeter 4.0LF Energy Webinar - Unveiling OpenEEMeter 4.0
LF Energy Webinar - Unveiling OpenEEMeter 4.0DanBrown980551
 
Q4 2023 Quarterly Investor Presentation - FINAL - v1.pdf
Q4 2023 Quarterly Investor Presentation - FINAL - v1.pdfQ4 2023 Quarterly Investor Presentation - FINAL - v1.pdf
Q4 2023 Quarterly Investor Presentation - FINAL - v1.pdfTejal81
 
Planetek Italia Srl - Corporate Profile Brochure
Planetek Italia Srl - Corporate Profile BrochurePlanetek Italia Srl - Corporate Profile Brochure
Planetek Italia Srl - Corporate Profile BrochurePlanetek Italia Srl
 
Introduction to RAG (Retrieval Augmented Generation) and its application
Introduction to RAG (Retrieval Augmented Generation) and its applicationIntroduction to RAG (Retrieval Augmented Generation) and its application
Introduction to RAG (Retrieval Augmented Generation) and its applicationKnoldus Inc.
 

Dernier (20)

3 Pitfalls Everyone Should Avoid with Cloud Data
3 Pitfalls Everyone Should Avoid with Cloud Data3 Pitfalls Everyone Should Avoid with Cloud Data
3 Pitfalls Everyone Should Avoid with Cloud Data
 
Automation Ops Series: Session 2 - Governance for UiPath projects
Automation Ops Series: Session 2 - Governance for UiPath projectsAutomation Ops Series: Session 2 - Governance for UiPath projects
Automation Ops Series: Session 2 - Governance for UiPath projects
 
March Patch Tuesday
March Patch TuesdayMarch Patch Tuesday
March Patch Tuesday
 
SIM INFORMATION SYSTEM: REVOLUTIONIZING DATA MANAGEMENT
SIM INFORMATION SYSTEM: REVOLUTIONIZING DATA MANAGEMENTSIM INFORMATION SYSTEM: REVOLUTIONIZING DATA MANAGEMENT
SIM INFORMATION SYSTEM: REVOLUTIONIZING DATA MANAGEMENT
 
Novo Nordisk's journey in developing an open-source application on Neo4j
Novo Nordisk's journey in developing an open-source application on Neo4jNovo Nordisk's journey in developing an open-source application on Neo4j
Novo Nordisk's journey in developing an open-source application on Neo4j
 
TrustArc Webinar - How to Live in a Post Third-Party Cookie World
TrustArc Webinar - How to Live in a Post Third-Party Cookie WorldTrustArc Webinar - How to Live in a Post Third-Party Cookie World
TrustArc Webinar - How to Live in a Post Third-Party Cookie World
 
The Importance of Indoor Air Quality (English)
The Importance of Indoor Air Quality (English)The Importance of Indoor Air Quality (English)
The Importance of Indoor Air Quality (English)
 
Design and Modeling for MySQL SCALE 21X Pasadena, CA Mar 2024
Design and Modeling for MySQL SCALE 21X Pasadena, CA Mar 2024Design and Modeling for MySQL SCALE 21X Pasadena, CA Mar 2024
Design and Modeling for MySQL SCALE 21X Pasadena, CA Mar 2024
 
Top 10 Squarespace Development Companies
Top 10 Squarespace Development CompaniesTop 10 Squarespace Development Companies
Top 10 Squarespace Development Companies
 
2024.03.12 Cost drivers of cultivated meat production.pdf
2024.03.12 Cost drivers of cultivated meat production.pdf2024.03.12 Cost drivers of cultivated meat production.pdf
2024.03.12 Cost drivers of cultivated meat production.pdf
 
Where developers are challenged, what developers want and where DevEx is going
Where developers are challenged, what developers want and where DevEx is goingWhere developers are challenged, what developers want and where DevEx is going
Where developers are challenged, what developers want and where DevEx is going
 
The Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightThe Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and Insight
 
Stobox 4: Revolutionizing Investment in Real-World Assets Through Tokenization
Stobox 4: Revolutionizing Investment in Real-World Assets Through TokenizationStobox 4: Revolutionizing Investment in Real-World Assets Through Tokenization
Stobox 4: Revolutionizing Investment in Real-World Assets Through Tokenization
 
My key hands-on projects in Quantum, and QAI
My key hands-on projects in Quantum, and QAIMy key hands-on projects in Quantum, and QAI
My key hands-on projects in Quantum, and QAI
 
Scenario Library et REX Discover industry- and role- based scenarios
Scenario Library et REX Discover industry- and role- based scenariosScenario Library et REX Discover industry- and role- based scenarios
Scenario Library et REX Discover industry- and role- based scenarios
 
LF Energy Webinar - Unveiling OpenEEMeter 4.0
LF Energy Webinar - Unveiling OpenEEMeter 4.0LF Energy Webinar - Unveiling OpenEEMeter 4.0
LF Energy Webinar - Unveiling OpenEEMeter 4.0
 
SheDev 2024
SheDev 2024SheDev 2024
SheDev 2024
 
Q4 2023 Quarterly Investor Presentation - FINAL - v1.pdf
Q4 2023 Quarterly Investor Presentation - FINAL - v1.pdfQ4 2023 Quarterly Investor Presentation - FINAL - v1.pdf
Q4 2023 Quarterly Investor Presentation - FINAL - v1.pdf
 
Planetek Italia Srl - Corporate Profile Brochure
Planetek Italia Srl - Corporate Profile BrochurePlanetek Italia Srl - Corporate Profile Brochure
Planetek Italia Srl - Corporate Profile Brochure
 
Introduction to RAG (Retrieval Augmented Generation) and its application
Introduction to RAG (Retrieval Augmented Generation) and its applicationIntroduction to RAG (Retrieval Augmented Generation) and its application
Introduction to RAG (Retrieval Augmented Generation) and its application
 

Django Framework Overview forNon-Python Developers

  • 1. Django Framework The web framework for perfectionists with deadlines Rosario Renga rosario.renga@ericsson.com
  • 2. 1. What is Django 2. What is Python 3. Django’s Capabilities a. All-in-One and Ready to Use b. Modularity c. Pattern: MTV and DRY d. Deployment strategies 4. Useful Links Summary
  • 3. › Django is a high-level Python Web framework. › Rapid development and clean, pragmatic design. › Focus on writing your app without needing to reinvent the wheel. › It’s free and open source. From https://www.djangoproject.com/ What is Django ?
  • 4.  Instagram: http://instagram.com/  Pinterest: https://www.pinterest.com/  The Washington Post:http://www.washingtonpost.com/  Mozilla’s blog: http://blog.mozilla.org/webdev/  My blog!  http://blog.itsmurfs.it/ Who use Django ?
  • 5.  Enterprise Point Of View  Free and Open-source.  Thousand of free reusable apps already pluggable into one’s project.  Compatible with all the main databases.  Compatible with all the JS and CSS Frameworks. Why Django ?
  • 6.  Developer Point Of View  Use and learn a new language: Python.  DB Management and ORM built-in.  Rich documentation.  Active community.  Modular architecture.  DRY Principle (Don’t Repeat Yourself).  MVC Pattern reinterpreted in MTV. Why DJAngo ?
  • 8.  Python is an interpreted, interactive, object-oriented programming language.  Platform indipendent.  Combines remarkable power with very clear syntax.  Very rich community and many libraries and frameworks.  It’s free and open source. What is python ?
  • 9.  Open google and search for: most used programming languages 2014 Who use Python?
  • 10. Syntax:  No “;” and “{ }”  Blocks starts with “:” and are identified by Indentation  No statically typed. You don’t need to declare any variable  You can mix object-oriented and imperative programming. What is python ?
  • 13.  List:  Declared using “[ ]”  Access using index  Mutable  Tuple:  Declared using “( )”  Access using index  Immutable  Dictionary:  Declared using “ { } “  Access using keyword Data Structure: What is python ?
  • 14.  Easy to install:  Download and Install Python: https://www.python.org/downloads/  Install pip ( https://bootstrap.pypa.io/get-pip.py ):  Install Django Django’s Capabilities python get-pip.py pip install django
  • 15. › Don’t worry there is an IDE that can do these dirties things for you: › Or you can use Eclipse with pyDev (http://pydev.org/ ) › Ready to use:  To start a new project just type in a cmd:  Then starts a new app with: Django’s Capabilities django-admin.py startproject mysite python manage.py startapp polls
  • 16.  Let’s look at the structure the commands have created: Django’s Capabilities Project root Project package App package Project configurations files Application files
  • 17. All in one: › With these two commands we have:  Created the project structure  Installed the ORM  Installed a development server  Installed and configured an SQLite database  Installed the admin interface  Installed a ready to use unit-test environement Django’s Capabilities – Create the database tables based on the models found in the installed apps. – Create the database for the authentication system included in django – Create a superuser account for the authentication system – Set up a system for propagating change makes to the models into the database schema python manage.py migrate
  • 18.  Modularity:  You can take existing Python packages or Django apps and compose them into your own web project. You only need to write the parts that make your project unique.  Built-in reusable apps:  django.contrib.admin – The admin site.  django.contrib.auth – An authentication system.  django.contrib.contenttypes – A framework for content types.  django.contrib.sessions – A session framework.  django.contrib.messages – A messaging framework.  django.contrib.staticfiles – A framework for managing static files. Django’s Capabilities
  • 19.  Third party reusable apps:  Django REST framework is a framework to build REST APIs.  Celery is the standard to manage asynchronous, distributed job queues.  Django mailer provides a backend for sending email  django-allauth allows for both local and social authentication  django-grappelli A jazzy skin for the Django Admin-Interface  django-tables2 An app for creating HTML tables  django-dajax Easy to use library to create asynchronous presentation logic with django  And much more…. Django’s Capabilities › All these apps can be installed simply typing: pip install <app_name>
  • 20.  How to write reusable apps:  The app we have just created is already reusable!  Just copy and paste it to another project and link it in the settings.py  Of course there is a more complete way to package an app:  https://docs.djangoproject.com/en/1.7/intro/reusable- apps/#packaging-your-app  How to find more apps:  Check https://www.djangopackages.com/ a directory of reusable apps, sites, tools, and more for your Django projects  Ask to the community: https://groups.google.com/forum/#!forum/django-it  Try to search them: www.google.com Django’s Capabilities
  • 21. DRY (Don’t Repeat Yourself) The DRY principal was one of the fundamental concepts that Django was designed around. The DRY principal is all about keeping code simple and non repeating. This allows developers to reuse code they wrote for one project in another project. To help developers adhere to the DRY principle, Django forces users to use the MVC by initially creating a standard project structure. Django’s Capabilities
  • 22. A different interpretation of the MVC: MTV: Model View Template In django interpretation of MVC, the “view” describes the data that gets presented to the user. It’s not necessarily how the data looks, but which data is presented. The view describes which data you see, not how you see it. Furthermore, it’s sensible to separate content from presentation – which is where templates come in. In Django, a “view” describes which data is presented, but a view normally delegates to a template, which describes how the data is presented. Django’s Capabilities
  • 24.  Deployment Strategies:  In the cloud:  Heroku  Google Appengine  On a remote machine:  NGINX + uWSGI or Gunicorn  Apache + mod_wsgi Django’s Capabilities
  • 25.  Official site: https://www.djangoproject.com/  Official google groups: https://groups.google.com/forum/#!forum/django-users  Italian community: https://groups.google.com/forum/#!forum/django-it  Snippets of reusable code: https://djangosnippets.org/  Collection of useful links: http://www.fullstackpython.com/django.html Useful links › Learning sites: – https://docs.djangoproject.com/en/1.7/intro/ – http://www.tangowithdjango.com/ – http://tutorial.djangogirls.org/en/index.html – http://effectivedjango.com/tutorial/ – http://www.djangobook.com/en/2.0/index.html – http://stacktrace.it/site_media/luambo/uploads/2009/09/14/Copia_visione_Django.pdf