python - django-hstore 与 Django 1.6 的兼容性问题

标签 python django hstore django-postgresql django-hstore

django-hstore似乎与 Django 1.6 不兼容。我在运行服务器上遇到此错误。使用 Django 1.5.5 一切都是正确的。知道可能是什么问题吗?

请注意,我已按照警告中所述通过 import json 更改了 simplejson 导入,但问题仍然存在。

C:\Python27\lib\site-packages\django_orm\postgresql\hstore\forms.py:2: Deprecati
onWarning: django.utils.simplejson is deprecated; use json instead.
from django.utils import simplejson as json

Unhandled exception in thread started by
Traceback (most recent call last):
File "C:\Python27\lib\site-packages\django\utils\autoreload.py", line 93, in w
rapper
fn(args, *kwargs)
File "C:\Python27\lib\site-packages\django\core\management\commands\runserver.
py", line 98, in inner_run
self.validate(display_num_errors=True)
File "C:\Python27\lib\site-packages\django\core\management\base.py", line 310,
in validate
num_errors = get_validation_errors(s, app)
File "C:\Python27\lib\site-packages\django\core\management\validation.py", lin
e 34, in get_validation_errors
for (app_name, error) in get_app_errors().items():
File "C:\Python27\lib\site-packages\django\db\models\loading.py", line 196, in
get_app_errors
self.populate()
File "C:\Python27\lib\site-packages\django\db\models\loading.py", line 78, in
_populate
self.loadapp(app_name)
File "C:\Python27\lib\site-packages\django\db\models\loading.py", line 99, in
load_app
models = import_module('%s.models' % app_name)
File "C:\Python27\lib\site-packages\django\utils\importlib.py", line 40, in im
port_module
import(name)
File "c:\mygeosite\geodjango\basqui\models.py", line 13, in
from shapefile.models import *
File "c:\mygeosite\geodjango\shapefile\models.py", line 3, in
from django_orm.postgresql import hstore
File "C:\Python27\lib\site-packages\django_orm\postgresql\hstore__init__.py",
line 2, in
from django_orm.postgresql.hstore.managers import HStoreManager
File "C:\Python27\lib\site-packages\django_orm\postgresql\hstore\managers.py",
line 2, in
from django_orm.postgresql.hstore.query import HStoreQuerySet
File "C:\Python27\lib\site-packages\django_orm\postgresql\hstore\query.py", li
ne 54, in
from django_orm.cache.query import CachedQuerySet
File "C:\Python27\lib\site-packages\django_orm\cache\query.py", line 4, in dule>
from django.db.models.query import ITER_CHUNK_SIZE
ImportError: cannot import name ITER_CHUNK_SIZE

最佳答案

很高兴告诉您新版本兼容 django 1.6,开发版本也支持 python3。

通过 pip 升级并检查新的官方 django-hstore github 存储库:https://github.com/djangonauts/django-hstore

关于python - django-hstore 与 Django 1.6 的兼容性问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20078901/

相关文章:

python - Django Queryset 使用 .extra 查询多对多关系

python - Django - Stripe 订阅

ruby-on-rails - 我如何重组这个大型 PostgreSQL 9.3 表,以便从 Rails 应用程序更有效地建立索引和搜索?

Python的取模误区

python - 根据第一个值从元组列表中获取值

python - 如何旋转 x 轴标签

python - 如何将默认时间(但不是日期)添加到 DJango 中的 DateTimeField?

postgresql - 我应该在更新的数据模型中使用 hstore 吗?

java - Postgres hstore 转换工作错误

python - Keras Stateful LSTM fit_generator 如何使用 batch_size > 1