在Djang中对PostgreSQL HSTORE使用djanghstore时出错

2024-06-30 15:34:58 发布

您现在位置:Python中文网/ 问答频道 /正文

运行Django服务器时,出现以下错误:

    class HStoreDescriptor(models.fields.subclassing.Creator):
AttributeError: 'module' object has no attribute 'subclassing'

我使用的是目前最新的Django 1.10和Django hstore 1.4.2


Tags: djangonofieldsobjectmodels错误attributeclass
2条回答

将Django降级到1.9版本可以很容易地解决这个问题。看起来1.10版本还不稳定。在

pip install Django==1.9

你不需要在1.10上使用Django_Hstore扩展。在

添加'django.contrib.postgres公司'在已安装的应用程序中。在

如果在Postgres上没有启用hstrone,请运行sql脚本:CREATE EXTENSION IF NOT EXISTS hstore

在型号上: 添加:from django.contrib.postgres.fields import HStoreField

添加字段:data = HStoreField()

For More İnformation :

相关问题 更多 >