I'm attempting to use django-admin.py loaddata
to seed a database on a dev server. I am using django 1.7.1
. After symlinking the file to my project, when I tried to run the command I got this error:
django.core.exceptions.ImproperlyConfigured: Requested setting USE_I18N, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.
Which lead me to this question. So I attempted the recommended solution of export DJANGO_SETTINGS_MODULE=inventory_manage.settings
. However when I tried to run the loaddata
command again, I was met with this ImportError
:
ImportError: Could not import settings 'inventory_manager.settings' (Is it on sys.path? Is there an import error in the settings file?): No module named inventory_manager.settings
Further research lead to checking if my site was on the sys.path
for my virtualenv. Which it was:
/Users/Aaron/Development/inventory-manager <--This is it
/Users/Aaron/.virtualenvs/inventorymgr/lib/python27.zip
/Users/Aaron/.virtualenvs/inventorymgr/lib/python2.7
/Users/Aaron/.virtualenvs/inventorymgr/lib/python2.7/plat-darwin
/Users/Aaron/.virtualenvs/inventorymgr/lib/python2.7/plat-mac
/Users/Aaron/.virtualenvs/inventorymgr/lib/python2.7/plat-mac/lib-scriptpackages
/Users/Aaron/.virtualenvs/inventorymgr/Extras/lib/python
/Users/Aaron/.virtualenvs/inventorymgr/lib/python2.7/lib-tk
/Users/Aaron/.virtualenvs/inventorymgr/lib/python2.7/lib-old
/Users/Aaron/.virtualenvs/inventorymgr/lib/python2.7/lib-dynload
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages
/Users/Aaron/.virtualenvs/inventorymgr/lib/python2.7/site-packages
Yet when I run the loaddata
command, I'm still getting the same ImportError
. Any ideas?