problem with DJANGO_SETTINGS_MODULE

2,092 views
Skip to first unread message

bob gailer

unread,
Feb 19, 2016, 1:26:23 PM2/19/16
to django...@googlegroups.com
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.

James Schneider

unread,
Feb 20, 2016, 4:21:24 AM2/20/16
to django...@googlegroups.com

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

bob gailer

unread,
Feb 20, 2016, 3:37:31 PM2/20/16
to django...@googlegroups.com
On 2/19/2016 1:25 PM, bob gailer wrote:
> 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."
Red faced embarrassment - I had inadvertently switched from
python manage.py to django-admin runserver

Bob Gailer
Reply all
Reply to author
Forward
0 new messages