Is there a way to determine if Django is running on localhost and setting the DEBUG variable in settings.py accordingly.
DEBUG
settings.py
So that if I run the s
As suggested by Bernhard Vallant, you can just check for runserver in sys.argv.
runserver
sys.argv
You can just replace your DEBUG assignment in settings.py with this:
DEBUG = (sys.argv[1] == 'runserver')
You should also import sys somewhere in settings.py.
import sys