【实例简介】初学者的Django:使用Python和Django构建网站
Django for Beginners: Build websites with Python and Django
Build websites with Python and Django
初学者的Django:使用Python和Django构建网站
【实例截图】





【核心代码】
CONTENTS
Conclusion
33
Chapter 3: Pages App
34
Initial Set Up
34
Templates
36
Class-Based Views
38
URLs
39
About Page
41
Extending Templates
42
Tests
45
Git and GitHub
47
Local vs Production
47
Heroku
48
Deployment
51
Conclusion
53
Chapter 4: Message Board App
54
Initial Set Up
54
Create a database model
57
Activating models
58
Django Admin
59
Views/Templates/URLs
64
Adding New Posts
69
Tests
70
GitHub
73
Heroku Configuration
74
Heroku Deployment
75
Conclusion
76
Chapter 5: Blog App
78
Initial Set Up
78
Database Models
81
Admin
82CONTENTS
URLs
86
Views
87
Templates
88
Static Files
90
Individual Blog Pages
95
Tests
100
Git
101
Conclusion
102
Chapter 6: Forms
103
Forms
103
Update Form
112
Delete View
117
Tests
122
Conclusion
124
Chapter 7: User Accounts
126
Log In
126
Updated Homepage
129
Log Out Link
130
Sign Up
133
GitHub
138
Static Files
139
Heroku Config
142
Heroku Deployment
143
Conclusion
145
Chapter 8: Custom User Model
146
Initial Set Up
146
Custom User Model
148
Forms
151
Superuser
154
Conclusion
156CONTENTS
Chapter 9: User Authentication
157
Templates
157
URLs
160
Admin
164
Conclusion
168
Chapter 10: Bootstrap
169
Pages App
169
Tests
171
Bootstrap
174
Sign Up Form
179
Conclusion
185
Chapter 11: Password Change and Reset
186
Password Change
186
Customizing Password Change
188
Password Reset
190
Custom Templates
193
Conclusion
197
Chapter 12: Email
198
SendGrid
198
Custom Emails
207
Conclusion
211
Chapter 13: Newspaper App
212
Articles App
212
URLs and Views
217
Edit/Delete
221
Create Page
226
Conclusion
232
Chapter 14: Permissions and Authorization
233
Improved CreateView
233CONTENTS
Authorizations
234
Mixins
236
LoginRequiredMixin
238
UpdateView and DeleteView
239
Conclusion
241
Chapter 15: Comments
242
Model
242
Admin
243
Template
249
Conclusion
253
Chapter 16: Deployment
255
Environment Variables
256
.gitignore
257
DEBUG & ALLOWED HOSTS
258
SECRET_KEY
261
DATABASES
262
Static Files
263
Deployment Checklist
265
Git & GitHub
266
Heroku Deployment
267
Conclusion
269
Conclusion
271
Django For Professionals
271
Django for APIs
271
3rd Party Packages
272
Learning Resources
272
Python Books
273
Feedback
273
网友评论
我要评论