@@ -325,7 +325,7 @@ and where testing fits in.
325
325
326
326
**Third chapter: Automated deployment to real servers**
327
327
328
- * Gradually build up an Ansible playbook to deplor our containers on a real server
328
+ * Gradually build up an Ansible playbook to deploy our containers on a real server
329
329
330
330
* Again, use our FTs to check for any problems
331
331
@@ -386,7 +386,7 @@ and to use a real server instead.
386
386
our "real" server.
387
387
388
388
389
- NOTE: A clarification: in these chapter ,
389
+ NOTE: A clarification: in these chapters ,
390
390
we run tests _against_ our Docker container, or _against_ our staging server,
391
391
but that doesn't mean we run the tests _from_ Docker or _from_ our staging server.
392
392
We still run the tests from our own laptop,
407
407
408
408
And now we can try them against our docker server URL,
409
409
which once we've done the right docker magic,
410
- will be at _http://locahost :8888_
410
+ will be at _http://localhost :8888_
411
411
412
412
TIP: I'm deliberately choosing a different port to run Dockerised Django on (8888)
413
413
from the default port that a local `manage.py runserver` would choose (8080),
@@ -436,7 +436,7 @@ test_can_start_a_todo_list
436
436
selenium.common.exceptions.WebDriverException: Message: Reached error page: abo
437
437
ut:neterror?e=connectionFailure&u=http%3A//localhost:8888/&c=UTF-8&
438
438
f=regular&d=Firefox%20can%27t%20establish%20a%20connection%20to%20the%20server%
439
- 20at%20locahost .
439
+ 20at%20localhost .
440
440
441
441
442
442
Ran 1 tests in 5.518s
@@ -542,7 +542,7 @@ so I decided to stick with Docker. But you could definitely check it out!
542
542
543
543
You can follow along all the instructions in the book
544
544
by just substituing the `docker` binary for `podman` in all the CLI instructions,
545
- eg
545
+ e.g.
546
546
547
547
[role="skipme"]
548
548
[subs="specialcharacters,quotes"]
@@ -711,7 +711,7 @@ rather than just manually pip installing things
711
711
one by one, and having to remember to sync things
712
712
between local dev and docker,
713
713
we can "save" the list of packages we're using
714
- by creating a 'requirements.txt' filefootnote :[
714
+ by creating a 'requirements.txt' file.footnote :[
715
715
There are many other dependency management tools these days
716
716
so requirements.txt is not the only way to do it,
717
717
although it is one of the oldest and best established.
@@ -1116,13 +1116,13 @@ curl: (52) Empty reply from server
1116
1116
==== Essential Googling the Error Message
1117
1117
1118
1118
The need to map ports and the `-p` argument to `docker run` are something you just learn,
1119
- fairly on in learning Docker. But the next debugging step is quite a bit more obscure
1119
+ fairly early on in learning Docker. But the next debugging step is quite a bit more obscure
1120
1120
(although admittedly Itamar does address it in his
1121
1121
https://pythonspeed.com/articles/docker-connection-refused/[docker networking article],
1122
1122
did I already mention how excellent it is?).
1123
1123
1124
1124
1125
- But if we haven't read that, we can always resort to resort to the tried and tested "Googling the error message" technique instead
1125
+ But if we haven't read that, we can always resort to the tried and tested "Googling the error message" technique instead
1126
1126
(<<googling-the-error>>).
1127
1127
1128
1128
@@ -1189,7 +1189,7 @@ Looking good!
1189
1189
.On Debugging
1190
1190
*******************************************************************************
1191
1191
Let me let you in on a little secret. I'm actually bad at debugging.
1192
- We all have our psychological strengths and weakness ,
1192
+ We all have our psychological strengths and weaknesses ,
1193
1193
and one of my weaknesses is
1194
1194
that when I run into a problem I can't see an obvious solution to,
1195
1195
I want to throw up my hands way too soon
@@ -1285,7 +1285,7 @@ Run 'python manage.py migrate' to apply them.
1285
1285
1286
1286
NOTE: If you don't see this error,
1287
1287
it's because your src folder had the database file in it, unlike mine.
1288
- For the sake of argument, run `rm src/db.sqlite ` and re-run the build & run commands,
1288
+ For the sake of argument, run `rm src/db.sqlite3 ` and re-run the build & run commands,
1289
1289
and you should be able to repro the error. I promise it's instructive!
1290
1290
1291
1291
@@ -1371,13 +1371,14 @@ Running migrations:
1371
1371
Applying contenttypes.0001_initial... OK
1372
1372
[...]
1373
1373
Applying sessions.0001_initial... OK
1374
- [...]
1375
1374
$ *docker build -t superlists . && docker run \
1376
1375
-p 8888:8888 \
1377
1376
-v ./src/db.sqlite3:/src/db.sqlite3 \
1378
1377
-it superlists*
1379
1378
----
1380
1379
1380
+ //CSANAD: sessions.0001_initial is the last migration on the last line, removed `[...]`
1381
+
1381
1382
TIP: if you see an error saying: `django.db.utils.OperationalError`: "unable to open database file",
1382
1383
try stopping the container, `rm -rf src/db.sqlite3`, then re-run the migrate command
1383
1384
_outside_ the container, and the rebuild and run your image.
@@ -1435,7 +1436,7 @@ Tests and small steps some of the uncertainty out of deployment::
1435
1436
For developers, ops and infra work is always "fun",
1436
1437
by which I mean a process full of uncertainty and surprises.
1437
1438
My aim during this chapter was to show that a step-by-step approach
1438
- helps to minimse risk, especially when allied to a functional test suite
1439
+ helps to minimise risk, especially when allied to a functional test suite
1439
1440
that can help us to catch errors early.
1440
1441
1441
1442
// TODO amend the rest
0 commit comments