我目前正在 OSX 上使用 1.6.1 版和 2.7.5 版的 python 来完成官方 Django 教程。我正在研究第二部分,即管理界面。当我尝试访问 /admin/polls/poll/ 时,收到以下错误报告:
ImproperlyConfigured at /admin/polls/poll/
This query requires pytz, but it isn't installed.
Request Method: GET
Request URL: http://127.0.0.1:8000/admin/polls/poll/
Django Version: 1.6.1
Exception Type: ImproperlyConfigured
Exception Value:
This query requires pytz, but it isn't installed.
Exception Location: /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/db/backends/sqlite3/base.py in datetime_trunc_sql, line 196
Python Executable: /opt/local/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
Python Version: 2.7.5
我尝试通过安装 pip (需要安装 setuptools)来安装 pytz,但这没有什么区别。另外,我将第二次阅读本教程,我知道一个月前我没有遇到这个问题。更新到 Mavericks 会导致一些问题吗?
我也遇到了同样的错误。
我安装了 pytz
$ pip install pytz
然后我重新启动服务器。现在不再有例外了。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)