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 models.py. I figured I was going to use the same import headings as admin.py 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 > sys.path.append('E:/misite/') > 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 django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/f5cff386-8189-4729-9757-aec0122b53b3%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.