2024-06-30 15:34:58 发布
网友
运行Django服务器时,出现以下错误:
class HStoreDescriptor(models.fields.subclassing.Creator): AttributeError: 'module' object has no attribute 'subclassing'
我使用的是目前最新的Django 1.10和Django hstore 1.4.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
CREATE EXTENSION IF NOT EXISTS hstore
在型号上: 添加:from django.contrib.postgres.fields import HStoreField
from django.contrib.postgres.fields import HStoreField
添加字段:data = HStoreField()
data = HStoreField()
For More İnformation :
将Django降级到1.9版本可以很容易地解决这个问题。看起来1.10版本还不稳定。在
你不需要在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 :
相关问题 更多 >
编程相关推荐