Ask Your Question
0

can't import timezone

asked 2012-11-22 02:46:31 -0500

I have a very weird problem of import timezone issue after successfully installation with devstack. When you open the login page, you will see "Internal Server Error -500" and error logs captured below. I verified the related module of pytz has been already installed. But don't know why this happens. I have this problems in two machines which are ubuntu 11.10. I didn't see the problem in ubuntu12.04. Curiously!

=========================horizon log================================ [Thu Nov 22 11:17:03 2012] [error] Warning: Could not import Horizon dependencies. This is normal during installation. [Thu Nov 22 11:17:03 2012] [error] [client 9.187.160.169] mod_wsgi (pid=3801): Exception occurred processing WSGI script '/opt/stack/horizon/openstack_dashboard/wsgi/django.wsgi'. [Thu Nov 22 11:17:03 2012] [error] [client 9.187.160.169] Traceback (most recent call last): [Thu Nov 22 11:17:03 2012] [error] [client 9.187.160.169] File "/usr/lib/pymodules/python2.7/django/core/handlers/wsgi.py", line 250, in __call__ [Thu Nov 22 11:17:03 2012] [error] [client 9.187.160.169] self.load_middleware() [Thu Nov 22 11:17:03 2012] [error] [client 9.187.160.169] File "/usr/lib/pymodules/python2.7/django/core/handlers/base.py", line 47, in load_middleware [Thu Nov 22 11:17:03 2012] [error] [client 9.187.160.169] raise exceptions.ImproperlyConfigured('Error importing middleware %s: "%s"' % (mw_module, e)) [Thu Nov 22 11:17:03 2012] [error] [client 9.187.160.169] ImproperlyConfigured: Error importing middleware horizon.middleware: "cannot import name timezone" [Thu Nov 22 03:17:03 2012] [error] [client 9.187.160.169] mod_wsgi (pid=3800): Exception occurred processing WSGI script '/opt/stack/horizon/openstack_dashboard/wsgi/django.wsgi'. [Thu Nov 22 03:17:03 2012] [error] [client 9.187.160.169] Traceback (most recent call last): [Thu Nov 22 03:17:03 2012] [error] [client 9.187.160.169] File "/usr/lib/pymodules/python2.7/django/core/handlers/wsgi.py", line 250, in __call__ [Thu Nov 22 03:17:03 2012] [error] [client 9.187.160.169] self.load_middleware() [Thu Nov 22 03:17:03 2012] [error] [client 9.187.160.169] File "/usr/lib/pymodules/python2.7/django/core/handlers/base.py", line 47, in load_middleware [Thu Nov 22 03:17:03 2012] [error] [client 9.187.160.169] raise exceptions.ImproperlyConfigured('Error importing middleware %s: "%s"' % (mw_module, e))

[Thu Nov 22 03:17:03 2012] [error] [client 9.187.160.169] ImproperlyConfigured: Error importing middleware horizon.middleware: "cannot import name timezone"

edit retag flag offensive close merge delete

4 answers

Sort by ยป oldest newest most voted
0

answered 2012-12-04 04:05:45 -0500

thanks for you infor. I have checked the ./openstack_dashboard/local/local_settings.py, it is same as your setting.

edit flag offensive delete link more
0

answered 2012-11-30 06:21:57 -0500

I have had the same problem ..

edit flag offensive delete link more
0

answered 2012-11-30 06:38:23 -0500

rajeshkannan007 gravatar image

Hi Edward,

In order to change the timezone you can use either dashboard or inside /etc/openstack-dashboard/local_settings.py you can change the parameter below.

TIME_ZONE = "UTC"

and after chaning that you have to restart the apache2 and memcached..

$ sudo service apache2 restart $ sudo service memcached restart

now reload the dashboard and try to login..

Let me know if its helpful or not..

Regards, Rajesh kannan

edit flag offensive delete link more
0

answered 2013-01-07 07:48:03 -0500

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 (http://stackoverflow.com/questions/10...)

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2012-11-22 02:46:31 -0500

Seen: 312 times

Last updated: Jan 07 '13