Good day,

I'm getting import errors when I try to run a script to populate a database 
using models. I'm new to django so it means I haven't done anything special 
than follow djangobook and other beginner tutorials.

The script I would like to run is in the same folder as the I 
figured I was going to use the same import headings as but I'm 
getting the following error:

from .models import currentRecord
> SystemError: Parent module '' not loaded, cannot perform relative import

Further searching for solutions, I stumbled upon adding this lines:

from models import currentRecord

>     os.environ['DJANGO_SETTINGS_MODULE']='project.settings'
>     django.setup()

> 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 would really appreciate any pointers.

Thank you

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
To post to this group, send email to
Visit this group at
To view this discussion on the web visit
For more options, visit

Reply via email to