Pycharm: set environment variable for run manage.py Task
When using PyCharm along with Django, there are multiple sections where you can set environment variables (EVs):

File > Settings > Languages and Frameworks > Django

There's no purpose to set EVs here


File > Settings > Build, Execution, Deployment > Console > Python Console

There's no purpose to set EVs here


File > Settings > Build, Execution, Deployment > Console > Django Console

Set EVs here and they'll be accesible when using the PyCharm Python Console (which in a Django project opens a Django shell)


File > Settings > Tools > Terminal

Set EVs here and they'll be accesible when using the PyCharm Terminal (i.e when running python manage.py commands in the terminal)


Run > Edit configurations > [Your Django run configuration]

Set EVs here and they'll be accesible when using the PyCharm Run button



Tested on PyCharm 2020.2 using a virtual environment.
I have moved my SECRET_KEY value out of my settings file, and it gets set when I load my virtualenv. I can confirm the value is present from python manage.py shell.
When I run the Django Console, SECRET_KEY is missing, as it should. So in preferences, I go to Console>Django Console and load SECRET_KEY and the appropriate value. I go back into the Django Console, and SECRET_KEY is there.
As expected, I cannot yet run a manage.py Task because it has yet to find the SECRET_KEY. So I go into Run>Edit Configurations to add SECRET_KEY into Django server and Django Tests, and into the project server. Restart Pycharm, confirm keys.
When I run a manage.py Task, such as runserver, I still get KeyError: 'SECRET_KEY'.
Where do I put this key?