Firstly, Django only supports python 3.6 or above. The issue this causes is the fact that if using virtual environments mod-wsgi must be installed in the same python installation as the virtual environment version (1). Using ‘apt install lib-apache2-wsgi’ would no longer work in python 3.6 (2). Instead we needed to install using pip, within the virtual environment. Now Apache must also be told to load the WSGI module from the virtual environment, for this we needed add some directives to the apache2.conf file. These directives could be found by using the command ‘mod_wsgi-express module-config’ from within the virtual environment, the statements that are output from this command, must then be appended to the end of the apache2.conf file. These commands tell apache from where to load the wsgi module, and in particular tell it to load it from the virtual environment.
Following another error may occur along the lines of ‘Timeout when reading response headers from daemon process 'kishAI': /apps/kish.ai-PROD/kishAI/wsgi.py’. Doing a little research it seems this occurs sometimes as installations of numpy can create such conflicts (3). To resolve this inside of the apache2 configuration file for the website with the
Following the above, all issues were resolved.