Good Day everyone!
UPDATE: Resolved
Fix: I hashed the Redis database credentials and all is well.
There is obviously an issue with enviroment variables cross browser.
Looking for some insight or something I am missing please.
Situation:
I have been working on a bank simulation console to run in the browser using Pyodide through Docker using a Redis database.
Locally and in Docker, the console application functions as it should and have tested with both a VPS hosted Redis database and Redis enterprise cloud database.
Next Step and issue:
I installed and setup Pyodide to embed the Python console application on a website. Had a few issues with the .env file if I were using a different browser other than Chrome. I changed the way Python reads the values and now that is now sorted. I am using an .env file to keep the Redis server credentials obscure.
The fix was making use of dotenv.
Persistent Problem:
Running the embedded console in Chrome functions as it should. The moment I test in another browser, IE, Edge, Firefox, Safari or Chrome on my mobile, I now get:
"int() argument must be a string, a bytes-like object or a number, not 'NoneType'".
• I know that you cannot concatenate strings and integers and have used suitable syntax for that, eg:
mobile = r.get(str(name) + '_mobile') OR r.incr(str(name) + '_savings', savings_Amount)
UPDATE: Resolved
Fix: I hashed the Redis database credentials and all is well.
There is obviously an issue with enviroment variables cross browser.
Looking for some insight or something I am missing please.
Situation:
I have been working on a bank simulation console to run in the browser using Pyodide through Docker using a Redis database.
Locally and in Docker, the console application functions as it should and have tested with both a VPS hosted Redis database and Redis enterprise cloud database.
Next Step and issue:
I installed and setup Pyodide to embed the Python console application on a website. Had a few issues with the .env file if I were using a different browser other than Chrome. I changed the way Python reads the values and now that is now sorted. I am using an .env file to keep the Redis server credentials obscure.
The fix was making use of dotenv.
Persistent Problem:
Running the embedded console in Chrome functions as it should. The moment I test in another browser, IE, Edge, Firefox, Safari or Chrome on my mobile, I now get:
"int() argument must be a string, a bytes-like object or a number, not 'NoneType'".
• I know that you cannot concatenate strings and integers and have used suitable syntax for that, eg:
mobile = r.get(str(name) + '_mobile') OR r.incr(str(name) + '_savings', savings_Amount)
Last edited: