blob: 1bb2d4c315028096975cb67f10f497813a305452 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
|
Tutorial 1: Introduction
=============================
Slide 1 [00:08 | 00:08]
-------------
**Introduction to Django**
Slide 2 [00:20 | 00:28]
--------------
**Learning Objectives**
In this tutorial, we will learn about;
- What is a web application
- What is a web framework
- Why to use Django
- What is virtual
- Django installation
Slide 3 [00:15 | 00:53]
---------------
**System Requirements**
- Ubuntu 16.10
- Python 3.5 or higher version
- python3.4-venv (Install using *apt-get install python3.4-venv*)
Slide 4 [00:12 | 01:05]
---------------
**Pre-requisites**
In order to follow this tutorial, you need;
- Knowledge in Object Oriented Python Programming
- If not, see the Python tutorials on http://spoken-tutorial.org
Slide 5 [00:10 | 01:15]
----------------
**What is Django**
- Free and open source
- Web application framework
- written in Python
- Very popular
[Image of Django logo]
Slide 6 [00:35 | 01:50]
----------------
**What is a web application**

** Narration for this slide **
- An application stored on a remote computer i.e. server
- A server can be accessed by a user through a web browser
- A user communicates with the server by sending a 'request'
- The web application carries out actions as per the request
- It has 'database' to store and manipulate data
- It sends a response to the user
- The user's browser then displays this response
Slide 7 [00:16 | 02:06]
------------------
**What is a web Framework**
- Easy to develop web apps
- Provides
- Interface to DB
- Authentication (Login system)
- Templating engine (HTML rendering)
- Forms
Slide 8 [00:18 | 02:24]
-------------------
**Why Django**
- easy to start
- rapid development
- has a lot of pre-built features
- supports various database backends
- supports multilingual websites
- provides a user interface for administrative activities
Slide 9 [00:07 | 02:31]
--------------
**Where is Django used**
- Pinterest - A social image and web resource sharing site
- [Add Screenshot]
Slide 11 [00:05 | 02:36]
--------------
**Where is Django used**
- Instagram - A social photo sharing site
- [Add Screenshot]
Slide 12 [00:05 | 02:41]
--------------
**Where is Django used**
- Disqus - A commenting system that can be integrated on any web page
- [Add Screenshot]
Slide 13 [00:13 | 02:54]
---------------
**What is virtual environment**
- Create 'isolated' environment
- Does not require root access
- Install Python packages from PyPI
Demonstration [01:20 | 04:14]
----------------
**Working with virtual environments**
- Creating a virtual environment in Python 3
- *python3 -m venv ./myapp_env*
- Activate the environment
- *source ./myapp_env/bin/activate*
- Shell prompt will be *(myapp_env)user1:~$*
Demonstration [01:26 | 05:40]
---------------
**Install Django**
- Check if django is installed using;
- Command: *python -m django --version*
- If not installed then we see "No module named django"
- pip install django
- Again we check and now we see the django version
- Deactivate the environment
- deactivate
- You can also delete the virtual environment by deleting it's directory
- *rm -rf ./myapp_env*
Slide 13 [00:15 | 05:55]
---------------
** Assignment **
- Create a new virtual environment.
- Activate it.
- Install other version of django
** Followed by standard concluding slides ** [02:15 | 08:10]
|