I read from various posts that you can use DJANGO_SETTINGS_MODULE = APPNAME.settings to import model classes to run with python scripts on the linux command line. I tried running:
DJANGO_SETTINGS_MODULE=dishtank.settings PYTHONPATH=$HOME/pythonDirLocation python pythonScript.py
In my python script I need to import some classes from my model.py file in one of my apps so that I can edit tables inside my database. Is there anything I am missing for importing all my django settings for running with my script?
DJANGO_SETTINGS_MODULE = APPNAME.settingsshould bePROJECT.settings. I usually avoid that approach, and prefer usingsetup_environat the top of my standalone script.