1
1
[[chapter_10_production_readiness]]
2
- == Making our App Production-Ready
2
+ == Making Our App Production-Ready
3
3
4
4
.A Note for Early Release Readers
5
5
****
@@ -201,7 +201,7 @@ Ran 3 tests in 10.718s
201
201
OK
202
202
----
203
203
204
- Phew. Let's commit that
204
+ Phew. Let's commit that:
205
205
206
206
[subs="specialcharacters,quotes"]
207
207
----
@@ -387,12 +387,13 @@ See http://www.clearlytech.com/2014/01/04/12-factor-apps-plain-english/[
387
387
Another common way of handling this
388
388
is to have different versions of _settings.py_ for dev and prod.
389
389
That can work fine too, but it can get confusing to manage.
390
- Environment variables also have the advantage of working for non-Django stuff too...
390
+ Environment variables also have the advantage of working for non-Django stuff too.
391
391
]
392
392
393
393
394
394
==== Setting DEBUG=True and SECRET_KEY
395
395
396
+ //RITA: What do you mean by "this"? Please add a word or two for context.
396
397
There's lots of ways you might do this.
397
398
Here's what I propose; it may seem a little fiddly,
398
399
but I'll provide a little justification for each choice.
@@ -470,7 +471,7 @@ $ pass:specialcharacters,quotes[*docker build -t superlists . && docker run \
470
471
KeyError: 'DJANGO_SECRET_KEY'
471
472
----
472
473
473
- Ooops, and I forgot to set said secret key env var,
474
+ Oops. I forgot to set said secret key env var,
474
475
mere seconds after having dreamt it up!
475
476
476
477
@@ -505,7 +506,7 @@ AssertionError: 'To-Do' not found in 'Bad Request (400)'
505
506
506
507
==== ALLOWED_HOSTS is Required When Debug Mode is Turned Off
507
508
508
- Not quite! Let's take a look manually: <<django-400-error>>.
509
+ It's not quite working yet ! Let's take a look manually: <<django-400-error>>.
509
510
510
511
[[django-400-error]]
511
512
.An ugly 400 error
@@ -563,7 +564,7 @@ else:
563
564
====
564
565
565
566
This is a setting that we want to change,
566
- depending on whether our docker image is running locally,
567
+ depending on whether our Docker image is running locally,
567
568
or on a server, so we'll use the `-e` flag again:
568
569
569
570
@@ -581,7 +582,7 @@ $ *docker build -t superlists . && docker run \
581
582
==== Collectstatic is Required when Debug is Turned Off
582
583
583
584
An FT run (or just looking at the site) reveals that we've had a regression
584
- in our static files.
585
+ in our static files:
585
586
586
587
[role="small-code"]
587
588
[subs="specialcharacters,macros"]
@@ -759,7 +760,7 @@ Traceback (most recent call last):
759
760
django.db.utils.OperationalError: no such table: lists_list
760
761
----
761
762
762
- Re-create the datase with `./src/manage.py migrate` and we'll be back to a working state.
763
+ Re-create the database with `./src/manage.py migrate` and we'll be back to a working state.
763
764
764
765
Don't forget to commit our changes to _settings.py_,
765
766
and I think we can call it job done!
@@ -768,6 +769,8 @@ when considering production-readiness,
768
769
we've worked in small steps and used our tests all the way along,
769
770
and we're now ready to deploy our container to a real server!
770
771
772
+ Find out how, in our next exciting installment...
773
+
771
774
772
775
[role="pagebreak-before less_space"]
773
776
.Production-Readiness Config
0 commit comments