global name 'pytz' is not defined

3,421 views
Skip to first unread message

nin...@gmail.com

unread,
Jun 27, 2014, 4:01:31 PM6/27/14
to mezzani...@googlegroups.com
Hi,
I am looking for the fix to the error below.  I already tried adding to  /cartridge/shop/admin.py:

import pytz
from django.utils import timezone
from django.utils.timezone import utc

Also having same error at  /admin/blog/blogpost/

Thanks,
Ken
-----------

NameError at /admin/shop/product/

global name 'pytz' is not defined


Django Version: 1.6.5
Exception Value:
global name 'pytz' is not defined
Exception Location: /myprojects/EnvProVM3/lib/python2.7/site-packages/django_pyodbc/operations.py in _switch_tz_offset_sql, line 74
Python Executable: /myprojects/EnvProVM3/bin/python
Python Version: 2.7.5

Error during template rendering

In template /home/10019751/myprojects/EnvProVM3/lib/python2.7/site-packages/grappelli_safe/templates/admin/change_list.html, error at line 140

/home/10019751/myprojects/EnvProVM3/lib/python2.7/site-packages/django_pyodbc/operations.py in _switch_tz_offset_sql

            if pytz is None:


Josh Cartmell

unread,
Jun 27, 2014, 4:48:18 PM6/27/14
to mezzani...@googlegroups.com
I would guess that running:
pip install pytz

will fix your problem.


--
You received this message because you are subscribed to the Google Groups "Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mezzanine-use...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

nin...@gmail.com

unread,
Jun 27, 2014, 5:00:06 PM6/27/14
to mezzani...@googlegroups.com
I am running in virtualenv and pytz installed and on pip freeze list.

Ken Bolton

unread,
Jun 27, 2014, 5:04:46 PM6/27/14
to mezzanine-users
make sure pytz works:

$ python manage.py shell
>>> import pytz

Stephen McDonald

unread,
Jun 27, 2014, 5:12:39 PM6/27/14
to mezzani...@googlegroups.com
Looks like a bug recently fixed in django_pyodbc:


You probably don't have that fix.


--
You received this message because you are subscribed to the Google Groups "Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mezzanine-use...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Stephen McDonald
http://jupo.org

nin...@gmail.com

unread,
Jun 27, 2014, 5:49:02 PM6/27/14
to mezzani...@googlegroups.com, st...@jupo.org
Thanks Stephen, that is the fix I need.
Reply all
Reply to author
Forward
0 new messages