ImportError: Could not import settings


I am trying to serve an application but am getting the error ImportError: Could not import settings

I have included the error log below.

Any help would be greatly appreciated. And feel free to look at my code!

This is the result of echo $PATH


This is the error log output

2014-06-18 12:20:06,684 :ImportError: Could not import settings 'coffee_compost.settings' (Is it on sys.path? Is there an import error in the settings file?): No module named coffee_compost.settings

This is my WSGI file

activate_this = '/home/compostcoffee/.virtualenvs/coffee-compost/bin/'
execfile(activate_this, dict(__file__=activate_this))

import os
import sys

path = '/home/compostcoffee/coffeecompost/coffee_compost'

if path not in sys.path:


os.environ['DJANGO_SETTINGS_MODULE'] = 'coffee_compost.settings'

import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()

This is timely! I've been trying to put together a wiki page on how to debug import issues. Let me know if it helps?

Hi Sam,

Thanks for the reply - quite informative to understand what is actually going on.. but it didn't help.

I did manage to solve the problem though. I manually opened a terminal and ran echo sys.path (after import sys) and my path was not correct. I don't think the append function in the WSGI file was working, so I manually added it to the path in the terminal and it worked!



The WSGI file does not affect the path in the consoles. It only affects the path that is used by the web app.