Cannot run Django tests in Debugger

I am using Virtualenv/Django/jenkins/nose and can successfully run the project and the debugger - all of that works fine.

Nevertheless, I am trying to run the test cases and even debug them - but the settings file fails to import.

In the command line

python test

works fine.

I have tried adding paths to the environment variables, adding DJANGO_SETTINGS, etc, nothing works.

This is the error stack I get:

/Users/rburhum/.virtualenvs/amigoserver/bin/python /Applications/ test test /Users/rburhum/src/amigoserver/django/amigoserver
Testing started at 7:39 PM ...
Traceback (most recent call last):
  File "/Applications/", line 25, in <module>
    from import Command
  File "/Users/rburhum/.virtualenvs/amigoserver/lib/python2.7/site-packages/django/core/management/commands/", line 7, in <module>
    from django.test.utils import get_runner
  File "/Users/rburhum/.virtualenvs/amigoserver/lib/python2.7/site-packages/django/test/", line 5, in <module>
    from django.test.client import Client, RequestFactory
  File "/Users/rburhum/.virtualenvs/amigoserver/lib/python2.7/site-packages/django/test/", line 21, in <module>
    from django.test import signals
  File "/Users/rburhum/.virtualenvs/amigoserver/lib/python2.7/site-packages/django/test/", line 2, in <module>
    from django.db import connections
  File "/Users/rburhum/.virtualenvs/amigoserver/lib/python2.7/site-packages/django/db/", line 11, in <module>
    if DEFAULT_DB_ALIAS not in settings.DATABASES:
  File "/Users/rburhum/.virtualenvs/amigoserver/lib/python2.7/site-packages/django/utils/", line 184, in inner
  File "/Users/rburhum/.virtualenvs/amigoserver/lib/python2.7/site-packages/django/conf/", line 42, in _setup
    self._wrapped = Settings(settings_module)
  File "/Users/rburhum/.virtualenvs/amigoserver/lib/python2.7/site-packages/django/conf/", line 95, in __init__
    raise ImportError("Could not import settings '%s' (Is it on sys.path?): %s" % (self.SETTINGS_MODULE, e))
ImportError: Could not import settings 'amigoserver.amigoserver.settings' (Is it on sys.path?): No module named amigoserver.settings

Process finished with exit code 1

I am attaching an image of my test settings. Any place I should be looking at to find out why this works on the command line and not on PyCharm?

Thanks for your help

Screen Shot 2013-01-09 at 7.39.26 PM.png

Please sign in to leave a comment.