The problem has little to do with DJANGO_SETTINGS_MODULE. Pycharm sets this when creating the project. Instead Go to the little green “Play button” for running scripts. You want to configure it to run manage.py, ie you are configuring the play button to run the command python manage.py runserver.
Breakdown:
python——> run with python Intepreter
manage.py——–> run this script
runserver———> arguments
So go to the drop down to the left of the green play button
,
click on edit configurations. You will get a screen like this one
.
Fill it out as shown locating your manage.py source script. Make sure you include runserver on the arguments box. Now you can click the green debug button and you program will stop at the first breakpoint it ecounters allowing you to descend upon it in full debug mode watch variables and all. Now you can manually type python manage.py runserver on the terminal or use your newley configured run button.