Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
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 ...
› Django is a high-level Python Web framework.
› Rapid development and clean, pragmatic design.
› Focus on writing your ap...
 Instagram: http://instagram.com/
 Pinterest: https://www.pinterest.com/
 The Washington
Post:http://www.washingtonpost...
 Enterprise Point Of View
 Free and Open-source.
 Thousand of free reusable apps already pluggable into
one’s project.
...
 Developer Point Of View
 Use and learn a new language: Python.
 DB Management and ORM built-in.
 Rich documentation.
...
 Questions?
What is Django ?
 Python is an interpreted, interactive, object-oriented
programming language.
 Platform indipendent.
 Combines remarkab...
 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 nee...
What is python ?
What is python ?
 List:
 Declared using “[ ]”
 Access using index
 Mutable
 Tuple:
 Declared using “( )”
 Access using index
 Immut...
 Easy to install:
 Download and Install Python:
https://www.python.org/downloads/
 Install pip ( https://bootstrap.pypa...
› Don’t worry there is an IDE that can do these dirties things for you:
› Or you can use Eclipse with pyDev (http://pydev....
 Let’s look at the structure the commands have created:
Django’s Capabilities
Project root
Project package
App package
Pr...
All in one:
› With these two commands we have:
 Created the project structure
 Installed the ORM
 Installed a developme...
 Modularity:
 You can take existing Python packages or Django apps and compose
them into your own web project. You only ...
 Third party reusable apps:
 Django REST framework is a framework to build REST APIs.
 Celery is the standard to manage...
 How to write reusable apps:
 The app we have just created is already reusable!
 Just copy and paste it to another proj...
DRY (Don’t Repeat Yourself)
The DRY principal was one of the fundamental
concepts that Django was designed around.
The DRY...
A different interpretation of the MVC:
MTV: Model View Template
In django interpretation of MVC, the “view” describes the
...
 Deployment Strategies:
 In the cloud:
 Heroku
 Google Appengine
 On a remote machine:
 NGINX + uWSGI or Gunicorn
 ...
 Official site: https://www.djangoproject.com/
 Official google groups:
https://groups.google.com/forum/#!forum/django-u...
 Questions?
Thanks.
Django Framework Overview forNon-Python Developers
Upcoming SlideShare
Loading in …5
×

Django Framework Overview forNon-Python Developers

One of my workshop presented at my Entreprise. The talk is intended to introduce Non-Python Developers to the Dajngo world.

  • Be the first to comment

Django Framework Overview forNon-Python Developers

  1. 1. Django Framework The web framework for perfectionists with deadlines Rosario Renga rosario.renga@ericsson.com
  2. 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. 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. 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. 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. 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 ?
  7. 7.  Questions? What is Django ?
  8. 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. 9.  Open google and search for: most used programming languages 2014 Who use Python?
  10. 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 ?
  11. 11. What is python ?
  12. 12. What is python ?
  13. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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
  23. 23.  Deployment Strategies:  In the cloud:  Heroku  Google Appengine  On a remote machine:  NGINX + uWSGI or Gunicorn  Apache + mod_wsgi Django’s Capabilities
  24. 24.  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
  25. 25.  Questions? Thanks.

×