I set up a Django app using the PythonAnywhere wizard and also set up a virtual environment for it.
I am having issues setting up environment variables. I have followed the instructions https://help.pythonanywhere.com/pages/environment-variables-for-web-apps
I am trying to set a DEBUG environment variable, my ~/yogasite/.env reads as follows: DEBUG = False . However, the DEBUG value is still set to true.
I have used the link in the web tab to edit the wsgi file, located somewhere in the /var/www/ path. I added the following text:
from dotenv import load_dotenv
project_folder = os.path.expanduser('~/yogasite') # adjust as appropriate
load_dotenv(os.path.join(project_folder, '.env'))
There is another wsgi file located in the yogasite subfolder of my project folder, wsgi.py file, am I supposed to edit that file at all?
I used DEBUG = os.getenv("DEBUG") in my settings.py file.
It appears to have no effect though, because the site still continues to report that the DEBUG environment variable is set to True.
thanks for your help,