Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Introduction to Django Framework: A Comprehensive Guide for Beginners, Lecture notes of Project Management

As you already know, Django is a Python web framework. And like most modern framework, Django supports the MVC pattern. First let's see what is the Model-View-Controller (MVC) pattern, and then we will look at Djangoโ€™s specificity for the Model-View-Template (MVT) pattern. MVC Pattern When talking about applications that provides UI (web or desktop), we usually talk about MVC architecture. And as the name suggests, MVC pattern is based on three components: Model, View, and Controller. Check our MVC tutorial here to know more. DJANGO MVC - MVT Pattern The Model-View-Template (MVT) is slightly different from MVC. In fact the main difference between the two patterns is that Django itself takes care of the Controller part (Software Code that controls the interactions between the Model and View), leaving us with the template. The template is a HTML file mixed with Django Template Language (DTL). The following diagram illustrates how each of the components of the MVT pattern interacts with e

Typology: Lecture notes

2022/2023

Uploaded on 08/01/2023

jahnavi-m
jahnavi-m ๐Ÿ‡ฎ๐Ÿ‡ณ

1 document

1 / 7

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
21IE2047K: PROJECT BASED LEARNING-2
1. Course Description
This course provides an introduction to Python Full Stack Development,GIT- Git Integration with PYCHARM IDE,
PYTEST-Introduction, Installation, Integrating PYTEST to PYCHARM IDE, Run tests in parallel, fixtures,
parameterized tests. Python connectivity with Databases MYSQL, MongoDB CRUD operations, FLASK
FRAMEWORK,Request Objects Sending Form Data to Template, Advanced Features of Flask, Pagination Database
connectivity Sqlite3, MySQL Page Restrictions using decorators Errors Flash Message ,Working with Mails,
Django framework.
2. Aim :Understand the Concept of Django, characteristics of Django, Installation
3. Instructional Objectives
This Session is designed to: understand the design technique to solve given real world problems.
1. Remembering the Basic Python Concepts
2. Understand the Concept of python full stack development
3. Apply the Knowledge to Create the Application using Django
4. Analyze the Design Techniques to Solve the Design Techniques to Solve the real world problems using the
Frameworks.
4. Learning Outcomes
1. Describe types of Python Full Stack Development
2. Summarize basic concepts of Python basic concepts and OOPs Concepts and Frameworks
5.Module Description
๏‚ทCO1:Analyze the design technique to solve given real world problems
6.Session Introduction
Understand the Concept of Django, characteristics of Django, Installation
7.Session Description
Explanation using Web, Key features and key terms in Web, Client-Server Architecture, Features of
Django Framework
pf3
pf4
pf5

Partial preview of the text

Download Introduction to Django Framework: A Comprehensive Guide for Beginners and more Lecture notes Project Management in PDF only on Docsity!

21IE2047K: PROJECT BASED LEARNING-

1. Course Description

This course provides an introduction to Python Full Stack Development,GIT- Git Integration with PYCHARM IDE, PYTEST-Introduction, Installation, Integrating PYTEST to PYCHARM IDE, Run tests in parallel, fixtures, parameterized tests. Python connectivity with Databases MYSQL, MongoDB CRUD operations, FLASK FRAMEWORK,Request Objects Sending Form Data to Template, Advanced Features of Flask, Pagination Database connectivity Sqlite3, MySQL Page Restrictions using decorators Errors Flash Message ,Working with Mails, Django framework.

2. Aim : Understand the Concept of Django, characteristics of Django, Installation

3. Instructional Objectives

This Session is designed to: understand the design technique to solve given real world problems.

  1. Remembering the Basic Python Concepts
  2. Understand the Concept of python full stack development
  3. Apply the Knowledge to Create the Application using Django
  4. Analyze the Design Techniques to Solve the Design Techniques to Solve the real world problems using the Frameworks.

4. Learning Outcomes

  1. Describe types of Python Full Stack Development
  2. Summarize basic concepts of Python basic concepts and OOPs Concepts and Frameworks

5.Module Description

๏‚ท CO1: Analyze the design technique to solve given real world problems

6.Session Introduction

Understand the Concept of Django, characteristics of Django, Installation 7.Session Description Explanation using Web, Key features and key terms in Web, Client-Server Architecture, Features of Django Framework

Django - Basics Django is a high-level Python web framework that encourages rapid development and clean, pragmatic design. Django makes it easier to build better web apps quickly and with less code. Note โˆ’ Django is a registered trademark of the Django Software Foundation, and is licensed under BSD License. History of Django 2003 โˆ’ Started by Adrian Holovaty and Simon Willison as an internal project at the Lawrence Journal-World newspaper. 2005 โˆ’ Released July 2005 and named it Django, after the jazz guitarist Django Reinhardt. 2005 โˆ’ Mature enough to handle several high-traffic sites. Current โˆ’ Django is now an open source project with contributors across the world. Django โ€“ Design Philosophies Django comes with the following design philosophies โˆ’ Loosely Coupled โˆ’ Django aims to make each element of its stack independent of the others. Less Coding โˆ’ Less code so in turn a quick development. Don't Repeat Yourself (DRY) โˆ’ Everything should be developed only in exactly one place instead of repeating it again and again. Fast Development โˆ’ Django's philosophy is to do all it can to facilitate hyper-fast development.

The Model-View-Template (MVT) is slightly different from MVC. In fact the main difference between the two patterns is that Django itself takes care of the Controller part (Software Code that controls the interactions between the Model and View), leaving us with the template. The template is a HTML file mixed with Django Template Language (DTL). The following diagram illustrates how each of the components of the MVT pattern interacts with each other to serve a user request โˆ’ 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. Django - Environment Django development environment consists of installing and setting up Python, Django, and a Database System. Since Django deals with web application, it's worth mentioning that you would need a web server setup as well. Step 1 โ€“ Installing Python Django is written in 100% pure Python code, so you'll need to install Python on your system. Latest Django version requires Python 2.6.5 or higher for the 2.6.x branch or higher than 2.7.3 for the 2.7.x branch. If you're on one of the latest Linux or Mac OS X distribution, you probably already have Python installed. You can verify it by typing python command at a command prompt. If you see something like this, then Python is installed. $ python Python 2.7.5 (default, Jun 17 2014, 18:11:42) [GCC 4.8.2 20140120 (Red Hat 4.8.2-16)] on linux Otherwise, you can download and install the latest version of Python from the link http://www.python.org/download. Step 2 - Installing Django

Installing Django is very easy, but the steps required for its installation depends on your operating system. Since Python is a platform-independent language, Django has one package that works everywhere regardless of your operating system. You can download the latest version of Django from the link http://www.djangoproject.com/download. UNIX/Linux and Mac OS X Installation You have two ways of installing Django if you are running Linux or Mac OS system โˆ’ You can use the package manager of your OS, or use easy_install or pip if installed. Install it manually using the official archive you downloaded before. We will cover the second option as the first one depends on your OS distribution. If you have decided to follow the first option, just be careful about the version of Django you are installing. Let's say you got your archive from the link above, it should be something like Django-x.xx.tar.gz: Extract and install. $ tar xzvf Django-x.xx.tar.gz $ cd Django-x.xx $ sudo python setup.py install You can test your installation by running this command โˆ’ $ django-admin.py --version If you see the current version of Django printed on the screen, then everything is set. Note โˆ’ For some version of Django it will be django-admin the ".py" is removed. Windows Installation We assume you have your Django archive and python installed on your computer. First, PATH verification. On some version of windows (windows 7) you might need to make sure the Path system variable has the path the following C:\Python27;C:\Python27\Lib\site-packages\django\bin\ in it, of course depending on your Python version. Then, extract and install Django. c:>cd c:\Django-x.xx Next, install Django by running the following command for which you will need administrative privileges in windows shell "cmd" โˆ’ c:\Django-x.xx>python setup.py install To test your installation, open a command prompt and type the following command โˆ’ c:>django-admin.py --version

  1. What is Django?
  2. Why we are going to learn Django?
  3. How to create an application? 13.Summary Overview of the PFSD Concept 14.Terminal Questions--NA 12.Case Studies (Co Wise)--NA 13.Answer Key: NA 14.Glossary:NA 15.References of books, sites, links: Reference Books: Python Cookbook, Third Edition, by David Beazley and Brian K. Jones Django for Beginners: Build Websites with Python and Django Sites and Web links: https://www.linkedin.com/learning/paths/become-a-python-developer https://www.linkedin.com/learning/paths/advance-your-skills-in- python