Ok, figured it out! My issue was that I had to convert to ASCII the output. The following dispatcher code block works quite well and outputs the errors:
#!/usr/bin/python3.6
import os, sys, logging
application = None
try:
dirName = os.path.abspath(os.path.dirname(__file__) + '/..')
sys.path.insert(1, dirName)
sys.path.insert(1, dirName + "/libs")
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "stantoine.settings")
application = get_wsgi_application()
except Exception as e:
err = e
def _application(env, start_response):
global err
start_response('200 OK', [('Content-Type','text/html')])
return [b"Error: ", str(err).encode('ascii')]
application = _application
I do sys.path.insert to use my own libraries before the global ones... I'm trying to use python packages that I copied in my project libs directory. Of course, it would fail for binaries. However it works with the container ndegardin/apache-wsgi:django I created to experiment with that: https://hub.docker.com/r/ndegardin/apache-wsgi/tags/ (that's an Alpine, but it has all the python extensions listed on your https://krydos.heliohost.org/cgi-bin/modules36.py page). Now, I can tell that my error is:
Error: libjpeg.so.8: cannot open shared object file: No such file or directory
It is related to the Python package Pillow, which needs the libjpeg, libpng, libjpeg-dev, libpng-dev, and zlib packages (maybe the names are bit different on the Heliohost Linux distribution)... So... would it be possible to have the python Pillow >=3.0 package installed, with its required libraries? Should I open a different post? Thanks!