When you return values using a Python version 3 language with apache and wsgi, the returned values must be converted to bytes, otherwise, an error is thrown.
This video show how you can use variables and convert the output string to bytes to be processed by the WSGI API.