Share E-Book

Django Crash Course (Daniel Roy Greenfield, Audrey Roy Greenfield) (Z-Library)

Author Daniel Roy Greenfield, Audrey Roy Greenfield

Data
Language English

No Description

Format PDF
Size 6.0 MB
258
Views
0
Downloads
0.00
Total Donations
(First 20 pages)

Registered users can read the full content for free

Register as a Gaohf Library member to read the complete e-book online for free and enjoy a better reading experience.

Page 1
(This page has no text content)
Page 2
Django Crash Course Covers Python 3.8 and Django 3.x Daniel Roy Greenfeld, Audrey Roy Greenfeld 2020-03-10 Contents Copyright 22 Introduction 23 Why Learn Django? . . . . . . . . . . . . . . . . . . . 24 When the Going Gets Tough . . . . . . . . . . . . . . 26 This Book is intended for Django 3.x and Python 3.8 . 26 How This Book is Structured . . . . . . . . . . . . . . 27 Conventions Used in this Book . . . . . . . . . . . . . 27 1 The Ultimate Django Setup 29 1.1 Goal: A Professional-Quality Development Envi- ronment . . . . . . . . . . . . . . . . . . . . . . . 29 1.2 Core Concepts . . . . . . . . . . . . . . . . . . . 30 1.3 Step 1: Install Conda . . . . . . . . . . . . . . . . 31 1
Page 3
1.4 Step 2: Install Visual Studio Code . . . . . . . . 34 1.5 Step 3: Installing Git . . . . . . . . . . . . . . . . 35 1.6 Step 4: Installing PostgreSQL . . . . . . . . . . . 36 1.7 Summary . . . . . . . . . . . . . . . . . . . . . . 37 I Hello, World in Django 38 2 Hello, World in Django 38 2.1 The “Hello, World” of Python . . . . . . . . . . . 39 2.2 “Hello, World” of Django: Simple on Purpose . . 40 2.3 Projects Goals . . . . . . . . . . . . . . . . . . . 40 2.4 Prerequisites . . . . . . . . . . . . . . . . . . . . 40 3 Preparation: Install Dependencies 42 3.1 What’s a Dependency? . . . . . . . . . . . . . . . 42 3.2 Set Up a New Conda Environment . . . . . . . . 42 3.3 Install Django . . . . . . . . . . . . . . . . . . . . 43 3.4 Summary . . . . . . . . . . . . . . . . . . . . . . 44 4 Generate a Starter Django Project 45 4.1 Anatomy of a Bare-Bones Django Project . . . . 45 4.2 manage.py . . . . . . . . . . . . . . . . . . . . . . 46 4.3 settings.py . . . . . . . . . . . . . . . . . . . . . . 47 4.4 Other Settings . . . . . . . . . . . . . . . . . . . 48 4.5 Exercise . . . . . . . . . . . . . . . . . . . . . . . 49 2
Page 4
5 Create a Database and Run the Project 50 5.1 Ensure We Are in the Hellodjango project . . . . . 50 5.2 Creating the Database . . . . . . . . . . . . . . . 50 5.3 Start Up Runserver . . . . . . . . . . . . . . . . . 51 5.4 Runserver Has Started Up . . . . . . . . . . . . . 52 5.5 Success! . . . . . . . . . . . . . . . . . . . . . . . 52 6 Create a Django-Superuser 53 6.1 Stop runserver if It Is Still Running . . . . . . . . 53 6.2 Run createsuperuser . . . . . . . . . . . . . . . . . 54 6.3 Summary . . . . . . . . . . . . . . . . . . . . . . 54 7 Practice Using the Admin 55 7.1 Restart runserver . . . . . . . . . . . . . . . . . . 55 7.2 Visit the Admin . . . . . . . . . . . . . . . . . . . 55 7.3 Log in as Our Superuser . . . . . . . . . . . . . . 56 7.4 Explore the Admin . . . . . . . . . . . . . . . . . 56 7.5 Recreating the Hello, World in Django Database 57 7.6 Summary . . . . . . . . . . . . . . . . . . . . . . 57 8 Generate a Homepage App 59 8.1 Stop runserver if Needed . . . . . . . . . . . . . . 59 8.2 Generate a Starter Django App . . . . . . . . . . 59 8.3 Anatomy of a Simple 1-App Django Project . . . 59 8.4 Exercise . . . . . . . . . . . . . . . . . . . . . . . 60 8.5 Main Django Project vs Django Apps . . . . . . 60 3
Page 5
9 Prepping the Project for Templates 61 9.1 Configure Your Templates . . . . . . . . . . . . . 61 9.2 Save! . . . . . . . . . . . . . . . . . . . . . . . . . 62 9.3 Lists? Dictionaries? . . . . . . . . . . . . . . . . 62 10 Add a Simple Homepage View 64 10.1 Get to Know URL Routing . . . . . . . . . . . . 64 10.2 Add a URL Pattern for the Homepage . . . . . . 65 10.3 Double-Check the Code . . . . . . . . . . . . . . 66 10.4 Terminology: “Wire in the URL” . . . . . . . . . 67 10.5 Refresh the Page and Trigger an Error . . . . . . 67 11 Create Our First Django Template 69 11.1 Create a Templates Directory . . . . . . . . . . . 69 11.2 Add Index Template . . . . . . . . . . . . . . . . 69 11.3 Start Up Runserver . . . . . . . . . . . . . . . . . 70 11.4 View the First Page . . . . . . . . . . . . . . . . 70 11.5 Recap . . . . . . . . . . . . . . . . . . . . . . . . 71 11.6 Understanding Views and the Templateview Class 71 12 Working With Variables in Templates 73 12.1 Our First Templated Value . . . . . . . . . . . . 73 12.2 What Is my_statement? . . . . . . . . . . . . . . . . 73 12.3 Extend HomepageView . . . . . . . . . . . . . . . 74 12.4 Refresh the Homepage . . . . . . . . . . . . . . . 74 4
Page 6
12.5 Exercise: Play Around! . . . . . . . . . . . . . . 75 12.6 Common Questions . . . . . . . . . . . . . . . . . 75 13 Calling View Methods From Templates 77 13.1 Define a View Method . . . . . . . . . . . . . . . 77 13.2 Call the View Method From index.html . . . . . 77 13.3 Reload the Homepage . . . . . . . . . . . . . . . 78 14 Our First Project is Complete! 80 14.1 Summary . . . . . . . . . . . . . . . . . . . . . . 80 14.2 Next Steps . . . . . . . . . . . . . . . . . . . . . 80 II EveryCheese 82 15 The EveryCheese Project 83 15.1 Prerequisites . . . . . . . . . . . . . . . . . . . . 83 15.2 Prepare the EveryCheese Programming Environ- ment . . . . . . . . . . . . . . . . . . . . . . . . . 83 15.3 Create a New Virtual Environment . . . . . . . . 84 15.4 Reactivating Conda Environments . . . . . . . . 84 15.5 Summary . . . . . . . . . . . . . . . . . . . . . . 85 16 Using Cookiecutter and Template 86 16.1 Install the Cookiecutter Library . . . . . . . . . . 86 16.2 Cookiecutter Project Templates . . . . . . . . . . 88 16.3 Using django-crash-starter . . . . . . . . . . . . . 88 5
Page 7
16.4 What Happened? . . . . . . . . . . . . . . . . . . 90 16.5 Tips and Troubleshooting . . . . . . . . . . . . . 91 16.6 A Little Cookiecutter Background . . . . . . . . 92 17 Exploring the Generated Boilerplate 93 17.1 Some Basic Components . . . . . . . . . . . . . . 93 17.2 Summary . . . . . . . . . . . . . . . . . . . . . . 94 18 Starting Up Our New Django Project 95 18.1 Let’s Run the Project . . . . . . . . . . . . . . . 95 18.2 Go Into the EveryCheese Directory . . . . . . . . 95 18.3 Start PostgreSQL if Needed . . . . . . . . . . . . 96 18.4 Create the Database . . . . . . . . . . . . . . . . 97 18.5 How to Create It . . . . . . . . . . . . . . . . . . 97 18.6 Install the Dependencies . . . . . . . . . . . . . . 98 18.7 Run the Migrations . . . . . . . . . . . . . . . . . 98 18.8 Start Up Runserver . . . . . . . . . . . . . . . . . 99 19 Cheese Boilers 100 20 Initializing the Git Repo Committing and Push- ing 101 20.1 Why? . . . . . . . . . . . . . . . . . . . . . . . . 101 20.2 We’ll Use GitHub . . . . . . . . . . . . . . . . . . 101 20.3 Create the GitHub Project . . . . . . . . . . . . 101 20.4 Examine the GitHub Instructions . . . . . . . . . 103 20.5 Verify That the Files Got Committed . . . . . . 104 6
Page 8
21 Git Is Not for Stinky Cheeses 105 22 What We Get From The Users App 106 22.1 Register a Normal User . . . . . . . . . . . . . . 106 22.2 Verify Our Email . . . . . . . . . . . . . . . . . . 107 22.3 Why Are Emails Printed in the Console? . . . . 109 22.4 Explore the User Profile . . . . . . . . . . . . . . 110 22.5 Edit User Data . . . . . . . . . . . . . . . . . . . 111 22.6 Introducing UserUpdateView . . . . . . . . . . . . . 111 22.7 Introducing UserDetailview . . . . . . . . . . . . . 112 22.8 Understand the Name Field . . . . . . . . . . . . 113 22.9 Understand the Code for UserUpdateView . . . . . . 114 22.10Add Email Addresses . . . . . . . . . . . . . . . . 115 22.11What About the Code? . . . . . . . . . . . . . . 116 23 Adding User Bios 117 23.1 Add a Bio Field . . . . . . . . . . . . . . . . . . . 117 23.2 Create and Run Migrations . . . . . . . . . . . . 117 23.3 Update UserUpdateView . . . . . . . . . . . . . . 118 23.4 Try It Out . . . . . . . . . . . . . . . . . . . . . . 118 24 Adding Bio to User Detail Template 121 24.1 Update the User Detail Template . . . . . . . . . 121 24.2 Add Line Breaks . . . . . . . . . . . . . . . . . . 122 24.3 Commit Our Work . . . . . . . . . . . . . . . . . 123 7
Page 9
25 Introducing Tests 124 25.1 Why Test? . . . . . . . . . . . . . . . . . . . . . . 124 25.2 Running Tests . . . . . . . . . . . . . . . . . . . . 124 25.3 What Does a Test Look Like? . . . . . . . . . . . 126 25.4 The Test Foundations . . . . . . . . . . . . . . . 126 25.5 The Actual Test . . . . . . . . . . . . . . . . . . 127 25.6 Using the assert KeyWord . . . . . . . . . . . . . 128 25.7 Introducing coverage.py . . . . . . . . . . . . . . 129 25.8 Using coverage.py . . . . . . . . . . . . . . . . . . 129 25.9 Generate an HTML Coverage Report . . . . . . . 130 25.10More Users App Tests . . . . . . . . . . . . . . . 131 25.11Summary . . . . . . . . . . . . . . . . . . . . . . 131 26 User Profile Cheese 132 26.1 Avatars Will Fit Into Cheese Holes . . . . . . . . 132 27 The Cheeses App and Model 133 27.1 Make Sure We’re at the Project Root . . . . . . . 133 27.2 Create an App Called Cheeses . . . . . . . . . . 133 27.3 Move It Into the Project . . . . . . . . . . . . . . 133 27.4 Set the Cheese Config . . . . . . . . . . . . . . . 134 27.5 Add It to the List of Installed Apps . . . . . . . 134 27.6 Add the Cheese Model . . . . . . . . . . . . . . . 135 27.7 Create and Run the Initial Cheese Migration . . 138 8
Page 10
28 Trying Out the Cheese Model 140 28.1 Let’s Try It Out! . . . . . . . . . . . . . . . . . . 140 28.2 Django Shell vs. Shell Plus . . . . . . . . . . . . 140 28.3 Create a Cheese . . . . . . . . . . . . . . . . . . . 140 28.4 Evaluate and Print the Cheese . . . . . . . . . . 141 28.5 View the Cheese’s Name . . . . . . . . . . . . . . 141 28.6 Add a String Method . . . . . . . . . . . . . . . . 142 28.7 Try It Again . . . . . . . . . . . . . . . . . . . . 142 28.8 Commit Our Work . . . . . . . . . . . . . . . . . 143 29 Tests and Test Coverage 144 29.1 Check Test Coverage . . . . . . . . . . . . . . . . 144 29.2 Create a Module for Cheese Model Tests . . . . . 146 29.3 Let’s Test the __str__() Method. . . . . . . . . . 147 29.4 Enter “The Game of Test Coverage” . . . . . . . 148 29.5 Rules of the Game . . . . . . . . . . . . . . . . . 148 29.6 What’s the Point of All This Anyway? . . . . . . 149 29.7 Commit the Cheese Model Tests . . . . . . . . . 150 29.8 Summary . . . . . . . . . . . . . . . . . . . . . . 150 30 The Cheeserator 151 31 Adding Cheeses to the Admin 152 31.1 We Need a Superuser . . . . . . . . . . . . . . . . 152 31.2 Go to the Admin . . . . . . . . . . . . . . . . . . 152 9
Page 11
31.3 Explore the Admin So Far . . . . . . . . . . . . . 153 31.4 Register Cheese Model With the Admin . . . . . 153 31.5 Find Colby . . . . . . . . . . . . . . . . . . . . . 153 31.6 Enter More Cheeses via the Admin . . . . . . . . 154 31.7 Some Notes About the Django Admin . . . . . . 156 31.8 Commit Changes . . . . . . . . . . . . . . . . . . 156 31.9 Summary . . . . . . . . . . . . . . . . . . . . . . 157 32 Behind the Curtain 158 32.1 We Are in Control . . . . . . . . . . . . . . . . . 158 33 Class Based View Fundamentals 160 33.1 The Simplest Class-Based View . . . . . . . . . . 160 33.2 Adding More HTTP Methods . . . . . . . . . . . 161 33.3 Advantages of Class Based Views . . . . . . . . . 162 33.4 Composition . . . . . . . . . . . . . . . . . . . . . 162 33.5 Composition Part II . . . . . . . . . . . . . . . . 163 33.6 Intelligent Defaults . . . . . . . . . . . . . . . . . 164 33.7 Standardized HTTP Method Handling . . . . . . 164 33.8 Tips for Writing Class-Based Views . . . . . . . . 165 34 Writing the Cheese List View 166 35 Wiring in the List View Url 167 35.1 Define Cheese URL Patterns . . . . . . . . . . . 167 35.2 Include Cheese URLs in Root URLConf . . . . . 167 35.3 See the View in Action . . . . . . . . . . . . . . . 167 10
Page 12
36 The Cheese List Template 169 36.1 Create the List Template . . . . . . . . . . . . . 169 36.2 Fill in the Template . . . . . . . . . . . . . . . . 169 36.3 See the List in Action . . . . . . . . . . . . . . . 170 36.4 Add a Nav Link to the Cheese List . . . . . . . . 171 36.5 Explaining the cheeses:list Name . . . . . . . . . 172 36.6 Commit Our Work . . . . . . . . . . . . . . . . . 173 37 Add the CheeseDetailView 174 37.1 Add the CheeseDetailView URL Pattern . . . . . 174 37.2 Link List Items to Detail Pages . . . . . . . . . . 175 38 The Cheese Detail Template 177 38.1 Add a Cheese Detail Template . . . . . . . . . . 177 38.2 Visit Cheese Detail . . . . . . . . . . . . . . . . . 178 38.3 Commit Our Work . . . . . . . . . . . . . . . . . 178 39 Where to Dip Class Based Views 179 40 Writing Factories for Tests 180 40.1 Produce Cheese Test Data From Factories . . . . 180 40.2 Define a CheeseFactory . . . . . . . . . . . . . . . . 180 40.3 Try Out CheeseFactory . . . . . . . . . . . . . . . . 181 40.4 Delete the Bogus Cheese . . . . . . . . . . . . . . 182 40.5 Commit the Changes . . . . . . . . . . . . . . . . 183 11
Page 13
41 Why Use Factories 185 41.1 Factories and Unit Testing . . . . . . . . . . . . . 185 41.2 Approach 1: Calling Create() . . . . . . . . . . . 185 41.3 Approach 2: Calling CheeseFactory() . . . . . . . . 186 41.4 Other Uses . . . . . . . . . . . . . . . . . . . . . 187 41.5 Learn More About Factory Boy . . . . . . . . . . 187 42 Using Factories in Tests 188 42.1 Passing in Field Values Explicitly . . . . . . . . . 188 42.2 Bulk Generation . . . . . . . . . . . . . . . . . . 188 42.3 Reviewing Our Cheeses . . . . . . . . . . . . . . 189 42.4 Cheese Cleanup . . . . . . . . . . . . . . . . . . . 189 42.5 Replacing the Direct Cheese Model Call in Our Existing Test . . . . . . . . . . . . . . . . . . . . 190 42.6 Removing the Name Entirely . . . . . . . . . . . 191 42.7 Commit Our Work . . . . . . . . . . . . . . . . . 192 42.8 Summary . . . . . . . . . . . . . . . . . . . . . . 192 43 How Our Cheese Objects Feel About Your Tests193 44 Finding and Adding a Third Party Countries App195 44.1 Country of Origin . . . . . . . . . . . . . . . . . . 195 44.2 Benefiting From Open Source . . . . . . . . . . . 197 44.3 Check Django Packages . . . . . . . . . . . . . . 197 44.4 Review Django Countries on GitHub . . . . . . . 198 44.5 Look for the Release Number on PyPI . . . . . . 198 12
Page 14
44.6 Install It . . . . . . . . . . . . . . . . . . . . . . . 198 44.7 Implement in cheeses/models.py . . . . . . . . . 200 44.8 Migrations! . . . . . . . . . . . . . . . . . . . . . 201 45 Display Cheese Country Data 203 45.1 Add Cheese Countries in the Admin . . . . . . . 203 45.2 Display Country in Cheese Detail . . . . . . . . . 204 45.3 Run the Tests . . . . . . . . . . . . . . . . . . . . 205 45.4 Update CheeseFactory . . . . . . . . . . . . . . . . 205 45.5 Verify That CheeseFactory Works . . . . . . . . . . 206 45.6 Commit Our Work . . . . . . . . . . . . . . . . . 207 46 Implement Cheese Creation by Users 208 46.1 Add a Cheese Creation View . . . . . . . . . . . 208 46.2 Add the Corresponding URL Pattern . . . . . . . 209 46.3 Specify the Desired Form Fields . . . . . . . . . . 212 46.4 Define the Cheese Form Template . . . . . . . . . 212 46.5 Submit the Form . . . . . . . . . . . . . . . . . . 214 46.6 Implement Get_absolute_url() . . . . . . . . . . . 214 46.7 Resubmit the Form . . . . . . . . . . . . . . . . . 216 46.8 Link to the Add Cheese Form . . . . . . . . . . . 218 46.9 Commit the Changes . . . . . . . . . . . . . . . . 219 13
Page 15
47 Use Django Crispy Forms for Better Display 221 47.1 Isn’t as_p() Enough? . . . . . . . . . . . . . . . . 221 47.2 A Quick History Lesson . . . . . . . . . . . . . . 222 47.3 Crispy Forms and Cookiecutter Django . . . . . 223 47.4 Our Non-Crispy Form . . . . . . . . . . . . . . . 223 47.5 Use the Crispy Template Tag . . . . . . . . . . . 223 47.6 Reload the Add Cheese Form . . . . . . . . . . . 225 47.7 Commit the Changes . . . . . . . . . . . . . . . . 225 48 Understand View Mixins and LoginRequired- Mixin 227 48.1 User-Generated Content and Accountability . . . 227 48.2 Try Accessing the Add Cheese Form Anonymously 227 48.3 Require Login . . . . . . . . . . . . . . . . . . . . 228 48.4 Try Accessing It as Cheesehead . . . . . . . . . . 230 48.5 View Mixins . . . . . . . . . . . . . . . . . . . . . 230 48.6 Commit the Changes . . . . . . . . . . . . . . . . 231 49 Add a Creator Field and Update Our Cheese Records 232 49.1 Add a Creator Field . . . . . . . . . . . . . . . . 232 49.2 Make and Apply the Migration . . . . . . . . . . 233 49.3 Commit the Changes . . . . . . . . . . . . . . . . 234 14
Page 16
50 Track and Display the Cheese Creator 235 50.1 Set the Cheese Creator After Form Validation . . 235 50.2 Display the Creator on the Cheese Detail Pages . 236 50.3 Try It Out . . . . . . . . . . . . . . . . . . . . . . 237 50.4 Commit the Changes . . . . . . . . . . . . . . . . 238 51 Update the Cheese Factory 239 51.1 Run the Tests . . . . . . . . . . . . . . . . . . . . 239 51.2 Modify Cheese Factory . . . . . . . . . . . . . . . 239 51.3 Run the Tests, Again . . . . . . . . . . . . . . . . 240 51.4 Try CheeseFactory in the Shell . . . . . . . . . . . 240 51.5 Delete the Random Cheese . . . . . . . . . . . . 241 51.6 Delete the Random User . . . . . . . . . . . . . . 241 51.7 Commit the Changes . . . . . . . . . . . . . . . . 242 52 Update the Cheese Model Tests 243 52.1 Test Get_absolute_url() . . . . . . . . . . . . . . . 243 52.2 Commit the Changes . . . . . . . . . . . . . . . . 244 53 Test All the Cheese Views 245 53.1 What to Test? . . . . . . . . . . . . . . . . . . . 245 53.2 Start With Imports . . . . . . . . . . . . . . . . . 245 53.3 The First Cheese View Tests . . . . . . . . . . . 246 53.4 Really Test the Cheese List View . . . . . . . . . 250 53.5 Test the Cheese Detail View . . . . . . . . . . . . 251 15
Page 17
53.6 Test the Cheese Create View . . . . . . . . . . . 252 53.7 Commit the Changes . . . . . . . . . . . . . . . . 253 53.8 Conclusion . . . . . . . . . . . . . . . . . . . . . 253 54 Test All the Cheese URL Patterns 255 54.1 Add the Imported Cheese . . . . . . . . . . . . . 255 54.2 Write Our First Fixture . . . . . . . . . . . . . . 255 54.3 Test the Cheese List URL Pattern . . . . . . . . 256 54.4 Test the Add Cheese URL Pattern . . . . . . . . 256 54.5 Test the Cheese Detail URL Pattern . . . . . . . 257 54.6 Commit the Changes . . . . . . . . . . . . . . . . 258 55 Adding a CheeseUpdateView and Form Recycling259 55.1 Add the CheeseUpdateView . . . . . . . . . . . . 259 55.2 Wire in the URL Pattern . . . . . . . . . . . . . 260 55.3 Try It in the Browser . . . . . . . . . . . . . . . . 260 55.4 What Happened?!? . . . . . . . . . . . . . . . . . 262 55.5 Link to the Update Form . . . . . . . . . . . . . 265 55.6 Try It in the Browser . . . . . . . . . . . . . . . . 265 55.7 Make Login Required . . . . . . . . . . . . . . . . 265 55.8 Commit the Changes . . . . . . . . . . . . . . . . 266 56 Test the Cheese Forms and Update View 268 56.1 Refactoring our Cheese Fixture . . . . . . . . . . 268 56.2 Test the Add Cheese Page Title . . . . . . . . . . 269 16
Page 18
56.3 Test That CheeseUpdateView Is a Good View . . . . 270 56.4 Test That a Cheese Updates Correctly . . . . . . 271 56.5 Commit the Changes . . . . . . . . . . . . . . . . 272 57 EveryCheese is the Foundation! 273 57.1 Summary . . . . . . . . . . . . . . . . . . . . . . 273 57.2 Next Steps After This Book . . . . . . . . . . . . 274 57.3 Giving Us Feedback . . . . . . . . . . . . . . . . 275 III Aftermatter 276 58 Troubleshooting 276 58.1 Troubleshooting Conda Installations on Pre- Catalina OSX . . . . . . . . . . . . . . . . . . . . 276 58.2 Troubleshooting Conda Installations on Catalina or higher OSX . . . . . . . . . . . . . . . . . . . 276 58.3 Troubleshooting PostgreSQL: Role Does Not Exist 277 58.4 Troubleshooting PostgreSQL: Cannot Create Database . . . . . . . . . . . . . . . . . . . . . . 278 58.5 Troubleshooting PsycoPG2 . . . . . . . . . . . . 278 58.6 Troubleshooting GCC Errors on the Mac . . . . 278 58.7 Troubleshooting the MS Visual Studio Build Tools Error . . . . . . . . . . . . . . . . . . . . . 279 59 Changelog 280 59.1 Beta Changelog 2020-03-10 . . . . . . . . . . . . 280 59.2 Beta Changelog 2020-03-06 . . . . . . . . . . . . 280 17
Page 19
59.3 Beta Changelog 2020-03-03 . . . . . . . . . . . . 281 59.4 Beta Changelog 2020-02-26 . . . . . . . . . . . . 281 59.5 Beta Changelog 2020-02-22 . . . . . . . . . . . . 281 59.6 Beta Changelog 2020-02-21 . . . . . . . . . . . . 282 59.7 Beta Changelog 2020-02-19 . . . . . . . . . . . . 282 59.8 Alpha Changelog 2020-02-14 . . . . . . . . . . . . 283 59.9 Alpha Changelog 2020-02-11 . . . . . . . . . . . . 284 59.10Alpha Changelog 2020-02-07 . . . . . . . . . . . . 284 59.11Alpha Changelog 2020-02-05 . . . . . . . . . . . . 284 59.12Alpha Changelog 2020-02-04 . . . . . . . . . . . . 285 59.13Alpha Changelog 2020-02-03 . . . . . . . . . . . . 285 60 Acknowledgements 286 60.1 Tech Reviewers . . . . . . . . . . . . . . . . . . . 286 60.2 Contributors to 3.x Beta . . . . . . . . . . . . . . 287 60.3 Contributors to 3.x Alpha . . . . . . . . . . . . . 287 60.4 Typesetting . . . . . . . . . . . . . . . . . . . . . 288 List of Figures 1 Two Scoops Travels the World . . . . . . . . . . 23 2 Scientific Cheese-Based Diagram Explaining Why To Learn Django . . . . . . . . . . . . . . . . . . 24 3 Let’s start with the basics. . . . . . . . . . . . . . 38 4 It worked! Hooray! . . . . . . . . . . . . . . . . . 53 18
Page 20
5 Greetings, Hello World . . . . . . . . . . . . . . . 70 6 Greetings . . . . . . . . . . . . . . . . . . . . . . 75 7 Greeting with view method . . . . . . . . . . . . 78 8 The Tasty Cookiecutter Logo . . . . . . . . . . . 92 9 Illustration of cheese boiler, and the location of its boilerplate . . . . . . . . . . . . . . . . . . . . 100 10 Create repository on GitHub . . . . . . . . . . . 102 11 Stinky cheeses getting kicked out by a foot. . . . 105 12 Registration form . . . . . . . . . . . . . . . . . . 107 13 Verify email page . . . . . . . . . . . . . . . . . . 108 14 Verification email in console window . . . . . . . 109 15 Page with Confirm button . . . . . . . . . . . . . 110 16 Minimal user profile . . . . . . . . . . . . . . . . 111 17 UserUpdateView . . . . . . . . . . . . . . . . . . 112 18 UserDetailView . . . . . . . . . . . . . . . . . . . 113 19 UserUpdateView With Bio . . . . . . . . . . . . . 119 20 UserDetailView Without Bio . . . . . . . . . . . 120 21 UserDetailView With Bio . . . . . . . . . . . . . 122 22 No line breaks in UserDetailView . . . . . . . . . 123 23 A block of user profile cheese . . . . . . . . . . . 132 24 Slugs are awesome! . . . . . . . . . . . . . . . . . 137 25 94% coverage . . . . . . . . . . . . . . . . . . . . 144 26 Cheese model coverage . . . . . . . . . . . . . . . 145 27 The Cheeserator device for manipulating cheese. 151 19
The above is a preview of the first 20 pages. Register to read the complete e-book.

Recommended for You

Loading recommended books...
Failed to load, please try again later

Tip the Site

Scan the WeChat Pay or Alipay code to tip. No login required.

WeChat Pay
Alipay
Back to List