gpt4 book ai didi

python - 属性错误: 'NoneType' object has no attribute 'actions_with_auth_user_as_actor'

转载 作者:太空宇宙 更新时间:2023-11-03 18:08:14 24 4
gpt4 key购买 nike

我正在尝试使用此处的指南为我的项目配置 django-activity-stream django-activity-stream

我有模型用户(django-contrib-auth),文章

正如文档中提到的,我使用语句注册事件的模型

registry.register(User)
registry.register(Article)

执行 runserver 命令时,出现以下错误

Unhandled exception in thread started by <function wrapper at 0x7f3a680547d0>
Traceback (most recent call last):
File "/home/xxxx/local/lib/python2.7/site-packages/django/utils/autoreload.py", line 93, in wrapp
er
fn(*args, **kwargs)
File "/home/xxxx/local/lib/python2.7/site-packages/django/core/management/commands/runserver.py",
line 102, in inner_run
self.validate(display_num_errors=True)
File "/home/xxxx/local/lib/python2.7/site-packages/django/core/management/base.py", line 310, in
validate
num_errors = get_validation_errors(s, app)
File "/home/xxxx/local/lib/python2.7/site-packages/django/core/management/validation.py", line 34
, in get_validation_errors
for (app_name, error) in get_app_errors().items():
File "/home/xxxx/local/lib/python2.7/site-packages/django/db/models/loading.py", line 196, in get
_app_errors
self._populate()
File "/home/xxxx/local/lib/python2.7/site-packages/django/db/models/loading.py", line 75, in _pop
ulate
self.load_app(app_name, True)
File "/home/xxxx/local/lib/python2.7/site-packages/django/db/models/loading.py", line 99, in load
_app
models = import_module('%s.models' % app_name)
File "/home/xxxx/local/lib/python2.7/site-packages/django/utils/importlib.py", line 40, in import
_module
__import__(name)
File "/home/xxxx/local/lib/python2.7/site-packages/registration/models.py", line 15, in <module>
User = get_user_model()
File "/home/xxxx/local/lib/python2.7/site-packages/django/contrib/auth/__init__.py", line 127, in
get_user_model
user_model = get_model(app_label, model_name)
File "/home/xxxx/local/lib/python2.7/site-packages/django/db/models/loading.py", line 271, in get
_model
self._populate()
File "/home/xxxx/local/lib/python2.7/site-packages/django/db/models/loading.py", line 75, in _pop
ulate
self.load_app(app_name, True)
File "/home/xxxx/local/lib/python2.7/site-packages/django/db/models/loading.py", line 99, in load
_app
models = import_module('%s.models' % app_name)
File "/home/xxxx/local/lib/python2.7/site-packages/django/utils/importlib.py", line 40, in import
_module
__import__(name)
File "/home/xxxx/maldio/maldio_project/links/models.py", line 115, in <module>
registry.register(User)
File "/home/xxxx/local/lib/python2.7/site-packages/actstream/registry.py", line 85, in register
self[model_class] = setup_generic_relations(model_class)
File "/home/xxxx/local/lib/python2.7/site-packages/actstream/registry.py", line 39, in setup_gene
ric_relations
setattr(Action, attr_value, None)
AttributeError: 'NoneType' object has no attribute 'actions_with_auth_user_as_actor'

有什么我错过的吗?

提前致谢

最佳答案

这是 django-activity-stream 0.5.1 版本的问题。您可以通过删除 0.5.1 并安装 0.5 版本来修复此错误。

您可以在此处跟踪此错误:

https://github.com/justquick/django-activity-stream/issues/208

关于python - 属性错误: 'NoneType' object has no attribute 'actions_with_auth_user_as_actor' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26452368/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com