Not sure where your specific error is coming from but I have hosted web apps on Pythonanywhere and I used python-decouple to manage my .env files. Please see How to Use Python Decouple to set up and configure your environment variables.