Cannot import name timezone

Bug #1049570 reported by Edward
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Invalid
Undecided
Gabriel Hurley
devstack
Invalid
Undecided
Unassigned

Bug Description

With latest code installation with devstack, you will get " internal server error 500" when accessing dashboard login page. The horizon log tell that an error "importing middleware horizon.middleware: cannot import name timezone". I verified the timezone module in django.utils exists there.

============================Horizon Log============================
...
[Wed Sep 12 10:43:54 2012] [error] Warning: Could not import Horizon dependencies. This is normal during installation.
[Wed Sep 12 10:43:54 2012] [error] Warning: Could not import Horizon dependencies. This is normal during installation.
[Wed Sep 12 10:43:54 2012] [error] [client 192.168.156.156] mod_wsgi (pid=32481): Exception occurred processing WSGI script '/opt/stack/horizon/openstack_dashboard/wsgi/django.wsgi'.
[Wed Sep 12 10:43:54 2012] [error] [client 192.168.156.156] mod_wsgi (pid=32482): Exception occurred processing WSGI script '/opt/stack/horizon/openstack_dashboard/wsgi/django.wsgi'.
[Wed Sep 12 10:43:54 2012] [error] [client 192.168.156.156] Traceback (most recent call last):
[Wed Sep 12 10:43:54 2012] [error] [client 192.168.156.156] File "/usr/lib/pymodules/python2.7/django/core/handlers/wsgi.py", line 250, in __call__
[Wed Sep 12 10:43:54 2012] [error] [client 192.168.156.156] Traceback (most recent call last):
[Wed Sep 12 10:43:54 2012] [error] [client 192.168.156.156] File "/usr/lib/pymodules/python2.7/django/core/handlers/wsgi.py", line 250, in __call__
[Wed Sep 12 10:43:54 2012] [error] [client 192.168.156.156] self.load_middleware()
[Wed Sep 12 10:43:54 2012] [error] [client 192.168.156.156] self.load_middleware()
[Wed Sep 12 10:43:54 2012] [error] [client 192.168.156.156] File "/usr/lib/pymodules/python2.7/django/core/handlers/base.py", line 47, in load_middleware
[Wed Sep 12 10:43:54 2012] [error] [client 192.168.156.156] File "/usr/lib/pymodules/python2.7/django/core/handlers/base.py", line 47, in load_middleware
[Wed Sep 12 10:43:54 2012] [error] [client 192.168.156.156] raise exceptions.ImproperlyConfigured('Error importing middleware %s: "%s"' % (mw_module, e))
[Wed Sep 12 10:43:54 2012] [error] [client 192.168.156.156] raise exceptions.ImproperlyConfigured('Error importing middleware %s: "%s"' % (mw_module, e))
[Wed Sep 12 10:43:54 2012] [error] [client 192.168.156.156] ImproperlyConfigured: Error importing middleware horizon.middleware: "cannot import name timezone"
[Wed Sep 12 10:43:54 2012] [error] [client 192.168.156.156] ImproperlyConfigured: Error importing middleware horizon.middleware: "cannot import name timezone"
=================================================================

Revision history for this message
Gabriel Hurley (gabriel-hurley) wrote :

This isn't a problem in Horizon master. If this is currently an issue in devstack my guess would be a missing dependency (such as the pytz module). Adding devstack for further investigation, but closing for Horizon.

Changed in horizon:
assignee: nobody → Gabriel Hurley (gabriel-hurley)
status: New → Invalid
Revision history for this message
Edward (zhang-hare) wrote :

This problem is due to the old version of django, e.g version 1.3 on Ubuntu 11.04. This can be resolved by upgrade django to 1.4+. use following command to upgrade and verify.
sudo apt-get remove --purge python-django
sudo pip install --upgrade django
django-admin --version

Here's a link of how to-do.
http://stackoverflow.com/questions/10564757/turnkey-django-how-to-upgrade-django-to-1-4

My suggestion is the install script in devstack need to check the django version to upgrade if necessary.

Revision history for this message
Tom Fifield (fifieldt) wrote :

As Ubuntu 11.04 is marked as 'end of life', making this bug invalid

Changed in devstack:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.