Richard Knop
Richard Knop

Reputation: 83725

Ubuntu ImportError: Could not import settings (works on Mac)

I am dealing with a strange problem. I have a Django app with this structure:

README.md
venv/
projectname/
    manage.py
    proj/
        __init__.py
        settings/
            __init__.py
            default.py
            celery.py
            local.py
        urls.py
        wsgi.py
    app/
        __init__.py
        models.py

I have created a virtual environment like this:

virtualenv venv

Then I do:

cd projectname
source ../venv/bin/activate
python manage.py syncdb --no-input

This works beautifully on my development MacBook. I try the same command:

cd projectname
source ../venv/bin/activate
python manage.py syncdb --no-input

And I get this error:

  File "/usr/local/my-project/venv/local/lib/python2.7/site-packages/django/conf/__init__.py", line 132, in __init__
    % (self.SETTINGS_MODULE, e)
ImportError: Could not import settings 'proj.settings.local' (Is it on sys.path? Is there an import error in the settings file?): No module named local
(venv)ubuntu@app1:/usr/local/my-project/projectname$

I don't have any idea how to solve this problem. Any tips?

All Django commands work locally on my MacBook (syncdb, celery etc) but there seems to be some issue on Ubuntu.

Upvotes: 0

Views: 284

Answers (1)

Ignacio Vazquez-Abrams
Ignacio Vazquez-Abrams

Reputation: 799102

OS X's filesystem is case-insensitive by default, but Ubuntu's is not. Make sure that the filename under Ubuntu has the correct case.

Upvotes: 1

Related Questions