Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

ImportError: Could not import settings 'openstack_dashboard.settings'

Hello,

I installed OpenStack, including dashboard on a linux machine following the instructions in docs.openstack.org (specifically http://docs.openstack.org/havana/install-guide/install/yum/content/install_dashboard.html)

But the apache web server doesn’t work properly when I access the “dashboard” component using http://localhost/dashboard. I get “500 Internal Server Error”. And the httpd log indicates: mod_wsgi (pid=34193): Exception occurred processing WSGI script '/usr/share/openstack-dashboard/openstack_dashboard/wsgi/django.wsgi . . . File "/usr/lib/python2.6/site-packages/django/conf/__init__.py", line 95, in __init__ ImportError: Could not import settings 'openstack_dashboard.settings' (Is it on sys.path?)

The file django.wsi has: sys.path.insert(0, os.path.join(os.path.dirname(os.path.realpath(__file__)), '../..')) os.environ['DJANGO_SETTINGS_MODULE'] = 'openstack_dashboard.settings' Also There is a file /usr/share/openstack-dashboard/openstack_dashboard/settings.py and a file __init__.py so I’m not sure why it is complaining…

Currently my /etc/openstack-dashboard/ directory has 3 files: keystone_policy.json local_settings nova_policy.json And my directory /usr/share/openstack-dashboard has 5 files: manage.py manage.pyc manage.pyo openstack_dashboard static Directory /usr/share/openstack-dashboard/openstack_dashboard has several files including settings.py, settings.pyc, settings.pyo, __init__.py ...

Thanks for the help

11/20/2013 11am addition: I am using a RedHat 6.4 machine and I followed the instructions in http://docs.openstack.org/havana/install-guide/install/yum/content/install_dashboard.html to install dashboard. I installed keystone, glance and nova using yum. I already have ALLOWED_HOSTS=['10.160.20.161', 'localhost'] in /etc/openstack-dashboard/local_settings Here is what I see in /var/log/httpd/error_log :

[Wed Nov 20 11:16:33 2013] [error] [client ::1] mod_wsgi (pid=37278): Exception occurred processing WSGI script '/usr/share/openstack-dashboard/openstack_dashboard/wsgi/django.wsgi'. [Wed Nov 20 11:16:33 2013] [error] [client ::1] Traceback (most recent call last): [Wed Nov 20 11:16:33 2013] [error] [client ::1] File "/usr/lib/python2.6/site-packages/django/core/handlers/wsgi.py", line 219, in __call__ [Wed Nov 20 11:16:33 2013] [error] [client ::1] self.load_middleware() [Wed Nov 20 11:16:33 2013] [error] [client ::1] File "/usr/lib/python2.6/site-packages/django/core/handlers/base.py", line 39, in load_middleware [Wed Nov 20 11:16:33 2013] [error] [client ::1] for middleware_path in settings.MIDDLEWARE_CLASSES: [Wed Nov 20 11:16:33 2013] [error] [client ::1] File "/usr/lib/python2.6/site-packages/django/utils/functional.py", line 184, in inner [Wed Nov 20 11:16:33 2013] [error] [client ::1] self._setup() [Wed Nov 20 11:16:33 2013] [error] [client ::1] File "/usr/lib/python2.6/site-packages/django/conf/__init__.py", line 42, in _setup [Wed Nov 20 11:16:33 2013] [error] [client ::1] self._wrapped = Settings(settings_module) [Wed Nov 20 11:16:33 2013] [error] [client ::1] File "/usr/lib/python2.6/site-packages/django/conf/__init__.py", line 95, in __init__ [Wed Nov 20 11:16:33 2013] [error] [client ::1] raise ImportError("Could not import settings '%s' (Is it on sys.path?): %s" % (self.SETTINGS_MODULE, e)) [Wed Nov 20 11:16:33 2013] [error] [client ::1] ImportError: Could not import settings 'openstack_dashboard.settings' (Is it on sys.path?): No module named pbr.version