Reputation:
I have a pythonanywhere flask application setup. Everything works fine except for dotenv. I installed it using pip install python-dotenv on python 3.7 while my virtual environment was activated. I still get the module not found error though. Any solutions?
Upvotes: 0
Views: 654
Reputation:
It turns out I had to import dotenv in the var/www/www_my_web_app_wsgi.py file and load the environment variables from then and from my app.py use os.getenv to access them. Everything works perfect now.
Upvotes: 2