> After several days of running my server with no problem I am suddenly confronted with: > > "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." > > Researching the django docs did not help. > > settings.py is in .../mysite/mysite as per the tutorial. I am using a virtualenv > > Question:s why the change? It was working! > > There is no DJANGO_SETTINGS_MODULE environment variable > > I've tried (following the documentation) > set DJANGO_SETTINGS_MODULE=mysite.setting > > which results in (very long traceback) ending in > ImportError: No module named 'mysite > > I am running version 1.9, python 3,5. windows 10. > > Please guide me. >
It doesn't look like your settings and/or Django environment are being set up correctly. Are you running the dev server, or a production-grade setup like Apache/mod_wsgi? Does your site work using the dev server? Do the file paths in the long traceback look like they follow your virtualenv path? If not, I would assume that your virtualenv is not being introduced by the server process. As to why this issue didn't show up until days later, it's possible that you are running a production server where things were working, you made a change, and forgot to restart the server process to pick up the changes (which broke things). The processes do restart on their own due to many memory times, so they might randomly notice this issue days down the road. -James -- 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/CA%2Be%2BciVWnuj-Fe_U9o_bOr8_p8KQvYgoxUGN%3DGBK5SAk%3DJ9X%2BQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.