<filename>scripts/inventory_context.py
import sys
import os
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir)))
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir, os.pardir)))
__import__('manage')
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'

<filename>scripts/inventory_context.py
import sys
import os
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir)))
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir, os.pardir)))
__import__('manage')
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
