If you get the following error when trying to use a Django package from the interactive prompt in Pydev:
“ImportError: Settings cannot be imported, because environment variable DJANGO_SETTINGS_MODULE is undefined.”
You can solve it by setting the required environment variable in the __init__.py file of your app as follows:
import os os.environ['DJANGO_SETTINGS_MODULE'] = 'myapp.settings'