1
1
[[chapter_10_production_readiness]]
2
- == Making our App Production-Ready
2
+ == Making Our App Production-Ready
3
3
4
4
Our container is working fine but it's not production-ready.
5
5
Let's try to get it there, using the tests to keep us safe.
@@ -21,7 +21,7 @@ This chapter is still very fresh,
21
21
but the content is all there,
22
22
so you should be able to follow along.
23
23
24
- But as always I really, really need fedback .
24
+ But as always I really, really need feedback .
25
25
So please hit me up at [email protected] , or via
26
26
https://github.com/hjwp/Book-TDD-Web-Dev-Python/issues[GitHub Issues]
27
27
and Pull Requests.
@@ -58,6 +58,7 @@ an ORM, all sorts of middleware, the admin site...
58
58
"What else do you want, a pony?" Well, Gunicorn stands for "Green Unicorn",
59
59
which I guess is what you'd want next if you already had a pony...
60
60
61
+ //RITA: Was cmdg intentional?
61
62
//001
62
63
cmdg
63
64
@@ -182,7 +183,7 @@ Ran 3 tests in 10.718s
182
183
OK
183
184
----
184
185
185
- Phew. Let's commit that
186
+ Phew. Let's commit that:
186
187
187
188
[subs="specialcharacters,quotes"]
188
189
----
@@ -218,12 +219,13 @@ See http://www.clearlytech.com/2014/01/04/12-factor-apps-plain-english/[
218
219
Another common way of handling this
219
220
is to have different versions of _settings.py_ for dev and prod.
220
221
That can work fine too, but it can get confusing to manage.
221
- Environment variables also have the advantage of working for non-Django stuff too...
222
+ Environment variables also have the advantage of working for non-Django stuff too.
222
223
]
223
224
224
225
225
226
==== Setting DEBUG=True and SECRET_KEY
226
227
228
+ //RITA: What do you mean by "this"? Please add a word or two for context.
227
229
There's lots of ways you might do this.
228
230
Here's what I propose; it may seem a little fiddly,
229
231
but I'll provide a little justification for each choice.
@@ -301,7 +303,7 @@ $ pass:specialcharacters,quotes[*docker build -t superlists . && docker run \
301
303
KeyError: 'DJANGO_SECRET_KEY'
302
304
----
303
305
304
- Ooops, and I forgot to set said secret key env var,
306
+ Oops. I forgot to set said secret key env var,
305
307
mere seconds after having dreamt it up!
306
308
307
309
@@ -335,7 +337,7 @@ AssertionError: 'To-Do' not found in 'Bad Request (400)'
335
337
336
338
==== ALLOWED_HOSTS is Required When Debug Mode is Turned Off
337
339
338
- Not quite! Let's take a look manually: <<django-400-error>>.
340
+ It's not quite working yet ! Let's take a look manually: <<django-400-error>>.
339
341
340
342
[[django-400-error]]
341
343
.An ugly 400 error
@@ -393,7 +395,7 @@ else:
393
395
====
394
396
395
397
This is a setting that we want to change,
396
- depending on whether our docker image is running locally,
398
+ depending on whether our Docker image is running locally,
397
399
or on a server, so we'll use the `-e` flag again:
398
400
399
401
@@ -410,7 +412,7 @@ $ *docker build -t superlists . && \
410
412
==== Collectstatic is Required when Debug is Turned Off
411
413
412
414
An FT run (or just looking at the site) reveals that we've had a regression
413
- in our static files.
415
+ in our static files:
414
416
415
417
[role="small-code"]
416
418
[subs="specialcharacters,macros"]
456
458
457
459
We have a container that we're ready to ship to production!
458
460
459
- Find out how in the next exciting installment...
461
+ Find out how in the next exciting chapter installment...
460
462
461
463
462
464
0 commit comments