Chapter 18. Deploying Our New Code
It’s time to deploy our brilliant new validation code to our live servers. This will be a chance to see our automated deploy scripts in action for the second time. Let’s take the opportunity to make a little deployment checklist.
Note
At this point I always want to say a huge thanks to Andrew Godwin and the whole Django team. In the first edition, I used to have a whole long section, entirely devoted to migrations. Since Django 1.7, migrations now “just work”, so I was able to drop it altogether. I mean yes this all happened nearly ten years ago, but still—open source software is a gift. We get such amazing things, entirely for free. It’s worth taking a moment to be grateful, now and again.
The Deployment Checklist
Let’s make a little checklist of pre-deployment tasks:
-
We run all our unit tests and functional tests (FTs) in the regular way—just in case!
-
We rebuild our Docker image and run our tests against Docker on our local machine.
-
We deploy to staging, and run our FTs against staging.
-
Now we can deploy to prod.
Tip
A deployment checklist like this should be a temporary measure. Once you’ve worked through it manually a few times, you should be looking to take the next step in automation: continuous deployment straight to production using a CI/CD (continuous integration/continuous development) pipeline. We’ll touch on this in Chapter 25.
A Full Test Run Locally
Of course, under the watchful eye of the Testing Goat, we’re running ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access