first steps into proper deployment

alexΒ 13th May 2024 at 10:34am

My last intervention on the code left me with a functional MVP that already ran in a container. In the meantime, I bought a domain; the hour it took for the DNS to update to my IP was enough to set some other misc. things.

One is not supposed to deploy Django with its runserver command in a production environment; this is amply stated in its documentation:

DO NOT USE THIS SERVER IN A PRODUCTION SETTING. It has not gone through security audits or performance tests. (And that’s how it’s gonna stay. We’re in the business of making web frameworks, not web servers, so improving this server to be able to handle a production environment is outside the scope of Django.)

the Django people themselves

A sane stance if I have ever seen one!

It had been a while since I used gunicorn, and so I found some guides online to skim and get a grasp of things. But there's an issue: if the process is ran in the background (as daemon = True would put it), the container stops; and that is not good.

As the container is now stably up-and-running, a few things shall be done. An HTTPS certificate β€” with some Let's Encrypt (almost literal) magic, that is very easy to achieve πŸͺ„ β€” ensures encrypted communication back and forth, but there are some other things on my mind, too: Django deploys static files in a different way.