Skip to content Skip to sidebar Skip to footer

Improperlyconfigured: Requested Setting Default_index_tablespace, But Settings Are Not Configured

I'm trying to make an SMTP live server as a separate app in django. Whenever I try to run the smtp file python smtp.py to listen to incoming messages and store them in models, I ge

Solution 1:

Looks like you're getting that error because DB engin is missing some important settings. What if you edit your code like this?

import sys, os
sys.path.append('/path/to/your/app')
os.environ['DJANGO_SETTINGS_MODULE'] = 'hello.settings'
from django.conf import settings
print"Started listening at port 1025"
...

Or another way is try to move os.environ.setdefault("DJANGO_SETTINGS_MODULE", "hello.settings") on the top of your file (but after importing os, of course) Another a little bit dirty hack is:

if__name__== "__main__":
    from django.core.management import execute_from_command_line    
    execute_from_command_line(sys.argv)

Next thing you could try:

$ ./manage.py shell
...>>>execfile('your_script.py')

Also, which line throws and exception?

Post a Comment for "Improperlyconfigured: Requested Setting Default_index_tablespace, But Settings Are Not Configured"