djangoforbeginners(1).pdf

(14704 KB) Pobierz
Django for Beginners
Build websites with Python & Django
William S. Vincent
This book is for sale at
http://leanpub.com/djangoforbeginners
This version was published on 2019-12-10
This is a
Leanpub
book. Leanpub empowers authors and publishers with the Lean
Publishing process.
Lean Publishing
is the act of publishing an in-progress ebook
using lightweight tools and many iterations to get reader feedback, pivot until you
have the right book and build traction once you do.
© 2018 - 2019 William S. Vincent
Also By
William S. Vincent
Django for APIs
Django for Professionals
Contents
Introduction
Why Django
Why This Book
Book Structure
Book Layout
Official Source Code
Conclusion
Chapter 1: Initial Set Up
The Command Line
Install Python 3
Virtual Environments
Install Django
Install Git
Text Editors
Conclusion
Chapter 2: Hello World App
Initial Set Up
Create An App
URLs, Views, Models, Templates
Hello, World!
Git
1
1
3
4
5
6
7
8
8
11
11
12
17
18
18
19
19
24
27
30
31
CONTENTS
GitHub
SSH Keys
Conclusion
Chapter 3: Pages App
Initial Set Up
Templates
Class-Based Views
URLs
Add an About Page
Extending Templates
Tests
Git and GitHub
Local vs Production
Heroku
Additional Files
Deployment
Conclusion
Chapter 4: Message Board App
Initial Set Up
Create a database model
Activating models
Django Admin
Views/Templates/URLs
Adding New Posts
Tests
GitHub
Heroku Configuration
Heroku Deployment
32
38
39
40
40
42
45
46
47
49
52
54
55
56
57
60
62
63
63
66
67
68
74
79
81
86
86
88
Zgłoś jeśli naruszono regulamin