Django Settings folder ImportError
Question: I am replacing the Django settings file for a folder of different settings.
The directory of the structure looks like this:

    
    
        .
        ├── manage.py
        ├── media
        ├── quito_events
        │   ├── __init__.py
        │   ├── urls.py
        │   └── wsgi.py
        ├── settings
        │   ├── __init__.py
        │   ├── base.py
        │   ├── ci.py
        │   ├── local.py
        │   ├── production.py
        │   ├── staging.py
        │   └── test.py
        ├── static
        ├── templates
        └── users
            ├── __init__.py
            ├── models.py
            ├── tests.py
            └── views.py
    

When I try to run:

    
    
    django-admin.py shell --settings=quito_events.settings.local
    
    
                Traceback (most recent call last):
                  File "/Users/eduardo/.virtualenvs/quito_events/bin/django-admin.py", line 5, in <module>
                    management.execute_from_command_line()
                  File "/Users/eduardo/.virtualenvs/quito_events/lib/python2.7/site-packages/django/core/management/__init__.py", line 453, in execute_from_command_line
                    utility.execute()
                  File "/Users/eduardo/.virtualenvs/quito_events/lib/python2.7/site-packages/django/core/management/__init__.py", line 392, in execute
                    self.fetch_command(subcommand).run_from_argv(self.argv)
                  File "/Users/eduardo/.virtualenvs/quito_events/lib/python2.7/site-packages/django/core/management/__init__.py", line 263, in fetch_command
                    app_name = get_commands()[subcommand]
                  File "/Users/eduardo/.virtualenvs/quito_events/lib/python2.7/site-packages/django/core/management/__init__.py", line 109, in get_commands
                    apps = settings.INSTALLED_APPS
                  File "/Users/eduardo/.virtualenvs/quito_events/lib/python2.7/site-packages/django/conf/__init__.py", line 53, in __getattr__
                    self._setup(name)
                  File "/Users/eduardo/.virtualenvs/quito_events/lib/python2.7/site-packages/django/conf/__init__.py", line 48, in _setup
                    self._wrapped = Settings(settings_module)
                  File "/Users/eduardo/.virtualenvs/quito_events/lib/python2.7/site-packages/django/conf/__init__.py", line 134, in __init__
                    raise ImportError("Could not import settings '%s' (Is it on sys.path?): %s" % (self.SETTINGS_MODULE, e))
                ImportError: Could not import settings 'quito_events.settings.local' (Is it on sys.path?): No module named quito_events.settings.local
    

What I am doing wrong?


Answer: You can switch to use manage.py, e.g.

    
    
    python manage.py shell --settings=quito_events.settings.local
    

or use django-admin.py with specified project path, e.g.

    
    
    django-admin.py shell --pythonpath=your_project_path --settings=quito_events.settings.local
    

