I am doing a Django introductory tutorial from here: https://docs.djangoproject.com/en/1.9/intro/tutorial05/
As described here, I opened the python shell and tried to import the project, for example:
from polls.models import Question
However, I get this error:
django.core.exceptions.ImproperlyConfigured: Requested setting DEFAULT_INDEX_TABLESPACE, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.
I do not understand the error message very well. Where exactly is DJANGO_SETTINGS_MODULE defined or call settings.configure() ?
If I try to open the django shell, I get the same message.
source share