I'm using Django 3.0.6 as a web interface for a python pool controller.
The web server is Nginx 1.14.2 with Gunicorn.
The system manages various items including, opening and closing valves, monitoring of valve positions, controlling pump speeds, pool lights, chlorinator, scheduling etc.
The software and the hardware build is coming along nicely, although it has been a massive learning curve for me.
I need to find a way that just after Nginx/Gunicorn/Django boot (i.e. when the server is ready), a simple python function is executed only once to set the default 'pool program' and schedule and system status variables.
The solutions that I have seen read and tried have various outcomes - running the start-up function twice, or only when the index page is requested, or not at all.
Thank you in advance.