@@ -288,6 +288,9 @@ else:
288
288
SECRET_KEY = "insecure-key-for-dev"
289
289
----
290
290
====
291
+ // CSANAD: I think variable names like "something_false" are confusing, since
292
+ // we need to set something to true so that they mean false.
293
+ // How about `DJANGO_ENV_PRODUCTION` or something similar?
291
294
292
295
<1> We say we'll use an environment variable called `DJANGO_DEBUG_FALSE`
293
296
to switch debug mode off, and in effect require production settings
@@ -308,6 +311,14 @@ against accidentally forgetting to set one.
308
311
TIP: Better to fail hard than allow a typo in an environment variable name to
309
312
leave you running with insecure settings.
310
313
314
+ // CSANAD: I think it would worth pointing out the development environment
315
+ // does not use Docker, launching the dev server should be done from
316
+ // the reader's host system. I think this isn't immediately obvious, e.g. I
317
+ // thought all along that from now on we would only run the server from Docker.
318
+ // If we end up making a TIP or similar about it, I think we should also mention
319
+ // in a development environment relying on containerization, programmers usually
320
+ // mount the whole /src minimizing the time-consuming rebuilding of their images.
321
+
311
322
==== Setting environment variables inside the Dockerfile
312
323
313
324
Now let's set that environment variable in our Dockerfile using the `ENV` directive:
@@ -489,6 +500,7 @@ ENV DJANGO_DEBUG_FALSE=1
489
500
CMD gunicorn --bind :8888 superlists.wsgi:application
490
501
----
491
502
====
503
+ // CSANAD: I think it would be important to use a non-privileged user in Docker
492
504
493
505
Well, it was fiddly, but that should get us to passing tests!
494
506
@@ -632,7 +644,7 @@ django.db.utils.OperationalError: no such table: lists_list
632
644
633
645
Re-create the datase with `./src/manage.py migrate` and we'll be back to a working state.
634
646
635
- Don't forget to commit our changes to _settings.py_,
647
+ Don't forget to commit our changes to _settings.py_ and _Dockerfile_ ,
636
648
and I think we can call it job done!
637
649
We've at least touched on many or most of the things you might need to think about
638
650
when considering production-readiness,
0 commit comments