1.52k likes | 6.65k Views
This tutorial will help to learn what Django framework is and how it is used for web development. Below are the topics covered in this Python Django tutorial: <br><br>1. What is a Web Framework? <br>2. Why Python Django? <br>3. What is Django? <br>4. Companies using Django <br>5. Django Installation <br>6. Django MVC- MVT Pattern <br>7. Demo - Get Started with Django
E N D
Copyright © 2017, edureka and/or its affiliates. All rights reserved.
Agenda ✓ What is a Web Framework? ✓ Why Python Django? ✓ What is Django? ✓ Companies using Django ✓ Installation ✓ Django MVC- MVT Pattern ✓ Get Started with Django ✓ Project – A Web Application Copyright © 2017, edureka and/or its affiliates. All rights reserved.
What is a Web Framework? Copyright © 2017, edureka and/or its affiliates. All rights reserved.
What is a Web Framework? A web framework is a server-side application framework that is designed to support the development of dynamic websites, web applications, web services and resources. A Python web framework is a code library that makes the life of a web application developer much easier for building flexible, scalable and maintainable web applications. Copyright © 2017, edureka and/or its affiliates. All rights reserved.
Web Framework ➢ Web frameworks provide tools and libraries to simplify common web development operations. ➢ The framework aims to alleviate the overhead associated with common activities performed in web development. It will make your life a lot easier. Copyright © 2017, edureka and/or its affiliates. All rights reserved.
Different Web Frameworks Copyright © 2017, edureka and/or its affiliates. All rights reserved.
Why Python Django? Copyright © 2017, edureka and/or its affiliates. All rights reserved.
Why Python Django? Tight Integration between Components Object-Relational Mapper (ORM) Automatic Administration Interface Multi-Lingual Support Copyright © 2017, edureka and/or its affiliates. All rights reserved.
What is Django? Copyright © 2017, edureka and/or its affiliates. All rights reserved.
What is Django? Django is a framework for building a fully functioning web application. Django web framework is written on quick and powerful Python language. Django is a high-level, MVC-style, open-source collection of libraries. Copyright © 2017, edureka and/or its affiliates. All rights reserved.
Features of Django Copyright © 2017, edureka and/or its affiliates. All rights reserved.
Features of Django FAST TONS OF PACKAGES SECURE Copyright © 2017, edureka and/or its affiliates. All rights reserved.
Features of Django SCALABLE VERSATILE Copyright © 2017, edureka and/or its affiliates. All rights reserved.
Job Trends Copyright © 2017, edureka and/or its affiliates. All rights reserved.
Job Trends Professionals who can go for Django: ✓ Web Developers ✓ UI Developers and Technical Leads ✓ Full Stack Developers ✓ QAs, Architects, and Technical Project Managers Source - Indeed.com Copyright © 2017, edureka and/or its affiliates. All rights reserved.
Python Django Developer Jobs Full Stack Developers 1 Sr. Python Software Developer 2 3 Backend Developer 4 Data Engineer Copyright © 2017, edureka and/or its affiliates. All rights reserved.
Companies using Django Copyright © 2017, edureka and/or its affiliates. All rights reserved.
Companies using Django Copyright © 2017, edureka and/or its affiliates. All rights reserved.
Installation Copyright © 2017, edureka and/or its affiliates. All rights reserved.
Installation Django can be installed on the system using Python’s package manager. ▪ You must have python and pip, python’s package manager installed beforehand ▪ Open the terminal and type the following command for Django installation. pip install django=1.11 Copyright © 2017, edureka and/or its affiliates. All rights reserved.
Installation Go to the link: 1 https://www.djangoproject. com/download/ Install the latest version of Django 2 Copyright © 2017, edureka and/or its affiliates. All rights reserved.
Model View Controller Copyright © 2017, edureka and/or its affiliates. All rights reserved.
Model View Controller MVC is a software design pattern for developing web applications. Model Model is responsible for managing and maintaining data. View View takes care of the presentation. It displays all or a portion of the data to the user. Controller It controls the interactions between the Model and View. Copyright © 2017, edureka and/or its affiliates. All rights reserved.
Django MVC-MVT Pattern Copyright © 2017, edureka and/or its affiliates. All rights reserved.
Django MVC-MVT Pattern ➢ MVC is slightly different from MVT as Django itself takes care of the Controller part. ➢ It leaves the template which is a HTML file mixed with Django Template Language (DTL). Model View Template Copyright © 2017, edureka and/or its affiliates. All rights reserved.
Model View Controller The developer provides the Model, the view and the template then just maps it to a URL and Django does the magic to serve it to the user. Copyright © 2017, edureka and/or its affiliates. All rights reserved.
Hands on Now, let’s create a basic Web App Copyright © 2017, edureka and/or its affiliates. All rights reserved.
Create a Project 1 Open the terminal and navigate to the folder where the project is to be created. $ django-admin startproject myproject 2 This will create a "myproject" folder with the following structure: Myproject/ manage.py myproject/ __init__.py settings.py urls.py wsgi.py Copyright © 2017, edureka and/or its affiliates. All rights reserved.
Project Structure Myproject/ myproject __init__.py “myproject” folder is just your project container or directory. You can rename it to anything you like. settings.py urls.py wsgi.py manage.py Copyright © 2017, edureka and/or its affiliates. All rights reserved.
Project Structure Myproject/ myproject __init__.py This folder is the actual python package of your project which contains some default files. settings.py urls.py wsgi.py manage.py Copyright © 2017, edureka and/or its affiliates. All rights reserved.
Project Structure Myproject/ myproject __init__.py It is an empty file that tells python that this folder should be treated as package. settings.py urls.py wsgi.py manage.py Copyright © 2017, edureka and/or its affiliates. All rights reserved.
Project Structure Myproject/ myproject __init__.py This contains the settings or the configurations of the project. settings.py urls.py wsgi.py manage.py Copyright © 2017, edureka and/or its affiliates. All rights reserved.
Project Structure Myproject/ myproject __init__.py This file contains all the links of your project and the function to call. settings.py urls.py wsgi.py manage.py Copyright © 2017, edureka and/or its affiliates. All rights reserved.
Project Structure Myproject/ myproject __init__.py It is an entry point for WSGI-compatible web services to serve your project. settings.py urls.py wsgi.py manage.py Copyright © 2017, edureka and/or its affiliates. All rights reserved.
Project Structure Myproject/ myproject __init__.py It is a command line utility that lets you interact with the Django project. settings.py urls.py wsgi.py manage.py Copyright © 2017, edureka and/or its affiliates. All rights reserved.
Your First Web App Hurray! We have successful created a basic Web App. Copyright © 2017, edureka and/or its affiliates. All rights reserved.
Project Copyright © 2017, edureka and/or its affiliates. All rights reserved.
Copyright © 2017, edureka and/or its affiliates. All rights reserved.