Error importing middleware horizon.middleware: "cannot import name timezone"

Bug #1084899 reported by jiji
This bug report is a duplicate of:  Bug #1049570: Cannot import name timezone . Edit Remove
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Incomplete
Undecided
Unassigned

Bug Description

when I installed the horizon , From the browser on :
apathe2's error.log:

mod_wsgi (pid=23723): Exception occurred processing WSGI script '/opt/stack/horizon-2012.2.1/openstack_dashboard/wsgi/django.wsgi'.
[Fri Nov 30 06:14:21 2012] [error] [client 192.168.xx.xx] Traceback (most recent call last):
[Fri Nov 30 06:14:21 2012] [error] [client 192.168.xx.xx] File "/usr/lib/pymodules/python2.7/django/core/handlers/wsgi.py", line 250, in __call__
[Fri Nov 30 06:14:21 2012] [error] [client 192.168.xx.xx] self.load_middleware()
[Fri Nov 30 06:14:21 2012] [error] [client 192.168.xx.xx] File "/usr/lib/pymodules/python2.7/django/core/handlers/base.py", line 47, in load_middleware
[Fri Nov 30 06:14:21 2012] [error] [client 192.168.xx.xx] raise exceptions.ImproperlyConfigured('Error importing middleware %s: "%s"' % (mw_module, e))
[Fri Nov 30 06:14:21 2012] [error] [client 192.168.xx.xx] ImproperlyConfigured: Error importing middleware horizon.middleware: "cannot import name timezone"

Tags: horizon
Revision history for this message
jiji (zzww-666) wrote :

I don't know how to do it .

Thierry Carrez (ttx)
information type: Private Security → Public
Revision history for this message
Julie Pichon (jpichon) wrote :

Hi jiji. To help you, we need a bit more information:
- How did you install Horizon?
- Which version of Horizon?
- What operating system you are using?
- Was this an upgrade?
- What steps, guide, or documentation did you follow?

At first sight, it looks like perhaps you are using Horizon with an older version of Django. Since Folsom, Horizon requires Django 1.4, which is when improved timezone support was added among other things.

Changed in horizon:
status: New → Incomplete
Revision history for this message
Edward (zhang-hare) wrote :

This problem is due to old version of django, e.g version 1.3 on Ubuntu 11.04. you can resolve it by upgrade django to 1.4+.

Revision history for this message
Edward (zhang-hare) wrote :

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
jiji (zzww-666) wrote :

Sorry to all , I too late reply .
Your answers to solve my problem.
Many thanks

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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