Django Tutorial-Build A Travel Blog PDF
Django Tutorial-Build A Travel Blog PDF
3
4
5
6
7
8
9
TUTORIAL 1
Introduction
11
1.1 Django installation & Environment setting(cont.)
12
1.1 Django installation & Environment setting(cont.)
13
1.1 Django installation & Environment setting(cont.)
14
TUTORIAL 1.2
Environment setting with IDE
15
1.2 Environment setting with Goorm IDE(cont.)
16
1.2 Environment setting with Goorm IDE(cont.)
17
18
1.2 Environment setting with Goorm IDE(cont.)
19
1.2 Environment setting with Goorm IDE(cont.)
① ② ③
20
1.2 Environment setting with Goorm IDE(cont.)
21
1.2 Environment setting with Goorm IDE(cont.)
22
1.2 Environment setting with Goorm IDE(cont.)
23
1.2 Environment setting with Goorm IDE(cont.)
24
1.2 Environment setting with Goorm IDE(cont.)
25
1.2 Environment setting with Goorm IDE(cont.)
root@Goorm:/workspace/tutorialdjango # cd mysite
root@Goorm:/workspace/tutorialdjango/mysite#
root@Goorm:/workspace/tutorialdjango/mysite#
26
1.2 Environment setting with Goorm IDE(cont.)
27
1.2 Environment setting with Goorm IDE(cont.)
Check the version of Python. Is it 2.x version? We will develop to version 3.4
It is a command for setting virtual environment that makes it run as 3.X version in the
environment that is currently running as 2.x version.
28
1.2 Environment setting with Goorm IDE(cont.)
The Migrate command will be explained later. In a nutshell, put values into DB.
29
1.2 Environment setting with Goorm IDE(cont.)
(myvenv)root@Goorm:/workspace/container name/mysite#
python manage.py runserver 0:80
30
1.2 Environment setting with Goorm IDE(cont.)
31
2. Create main page(cont.)
33
2. Create main page(cont.)
34
2. Create main page(cont.)
35
2. Create main page(cont.)
36
2. Create main page(cont.)
(myvenv)root@Goorm:/workspace/container name/mysite#
python manage.py runserver 0:80
37
2. Create main page(cont.)
https://yourURL/admin
38
2. Create main page(cont.)
39
2. Create main page(cont.)
40
2. Create main page(cont.)
41
2. Create main page(cont.)
42
2. Create main page(cont.)
43
2. Create main page(cont.)
44
2. Create main page(cont.)
mysite
__init__.py main
Index.html
45
2. Create main page(cont.)
Client
Response Request
Template URLs
DB
46
3. Create Blog page(cont.)
48
3. Create Blog page(cont.)
49
3. Create Blog page(cont.)
/)
50
3. Create Blog page(cont.)
(myvenv)root@Goorm:/workspace/container name/mysite
(myvenv)root@Goorm:/workspace/container name/mysite
51
3. Create Blog page(cont.)
52
3. Create Blog page(cont.)
root@Goorm:/workspace/container name/mysite
53
3. Create Blog page(cont.)
54
3. Create Blog page(cont.)
mysite/product/models.py
55
3. Create Blog page(cont.)
Add Post
56
3. Create Blog page(cont.)
tutorialdjango/mysite/main/views.py
57
3. Create Blog page(cont.)
58
3. Create Blog page(cont.)
59
4. Create Post page(cont.)
(myvenv)root@Goorm:/workspace/container name/mysite#
If you have been following the command without myvenv, we recommend you
delete the container now and start over again.
61
4. Create Post page(cont.)
62
4. Create Post page(cont.)
tutorialdjango/mysite/main/templates/main/postdetails.html
63
4. Create Post page(cont.)
https://tutorialdjango-okiim.run.Goorm.io/blog/1
- Executed page -
64
4. Create Post page(cont.)
tutorialdjango/mysite/main/templates/main/blog.html
65
4. Create Post page(cont.)
66
4. Create Post page(cont.)
Container name/mysite/main/templates/main/productdetails.html
67
4. Create Post page(cont.)
tutorialdjango/mysite/main/models.py
68
4. Create Post page(cont.)
(myvenv)root@Goorm:/workspace/container name/mysite#
69
4. Create Post page(cont.)
* Change post
* Add post
70
4. Create Post page(cont.)
tutorialdjango/mysite/tutorialdjango/settings.py
71
4. Create Post page(cont.)
72
4. Create Post page(cont.)
73
4. Create Post page(cont.)
74
4. Create Post page(cont.)
75
4. Create Post page(cont.)
76
5. Add Comments Box
Instrall disqus
https://disqus.com/
78
5. Add Comments Box (cont.)
79
5. Add Comments Box (cont.)
80
5. Add Comments Box (cont.)
81
5. Add Comments Box (cont.)
tutorialdjango/mysite/main/templates/main/postdetails.html
82
5. Add Comments Box (cont.)
83
5. Add Comments Box (cont.)
84
5. Add Comments Box (cont.)
Admin Site
85
5. Add Comments Box (cont.)
86
5. Add Comments Box (cont.)
tutorialdjango/mysite/main/templates/main/blog.html
https://tutorialdjango-bcrpr.run.Goorm.io/blog/
87
5. Add Comments Box (cont.)
tutorialdjango/mysite/main/models.py
88
5. Add Comments Box (cont.)
tutorialdjango/mysite/tutorialdjango/settings.py
89
5. Add Comments Box (cont.)
90
5. Add Comments Box (cont.)
tutorialdjango/mysite/main/templates/main/postdetails.html
91
5. Add Comments Box (cont.)
92
5. Add Comments Box (cont.)
93
TUTORIAL 6.1
Bootstrap Introduction
95
TUTORIAL 6.2
Bootstrap Download
96
TUTORIAL 6.3
Create a Template
97
98
TUTORIAL 6.4
Bootstrap Basic
99
6.4 Bootstrap Grids
100
6.4 Bootstrap Grids (cont.)
Output
101
6.4 Bootstrap Grids (cont.)
Output
102
6.4 Bootstrap Grids (cont.)
103
6.4 Bootstrap Grids (cont.)
104
6.4 Bootstrap Grids (cont.)
Output
105
TUTORIAL 6.5
Finishing touches with template code examples
106
6.5 Finishing touches with template code examples
107
6.5 Finishing touches with template code examples (cont.)
108
6.5 Finishing touches with template code examples (cont.)
109
6.5 Finishing touches with template code examples (cont.)
110
6.5 Finishing touches with template code examples (cont.)
111
6.5 Finishing touches with template code examples (cont.)
112
6.5 Finishing touches with template code examples (cont.)
113
6.5 Finishing touches with template code examples (cont.)
114
6.5 Finishing touches with template code examples (cont.)
115
6.5 Finishing touches with template code examples (cont.)
116
6.5 Finishing touches with template code examples (cont.)
117
6.5 Finishing touches with template code examples (cont.)
118
TUTORIAL 6.6
Deployment
119
6.6 Deployment
120
6.6 Deployment (cont.)
121
Django
123
Django
124
urls.py
125
views.py
126
models.py
127
Templates
128
ISBN 979-11-88786-10-7
129
Who should read this tutorial