首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Pybbm超级用户配置文件"UserProfile匹配查询不存在“。

Pybbm超级用户配置文件"UserProfile匹配查询不存在“。
EN

Stack Overflow用户
提问于 2013-03-26 15:36:58
回答 1查看 327关注 0票数 0

我在django 1.4.5上有一个项目,带有自定义的用户配置文件和新安装的pybbm,如本说明https://pybbm.readthedocs.org/en/latest/install.html#enable-your-site-profile中所述

在本说明中:“如果您启用了南向并使用南向控制下的配置文件类(如‘pybb.Profile’),将不会在同步/迁移后创建超级用户的配置文件。它将在此用户首次通过pybb.middleware.PybbMiddleware登录到站点时创建。”

但是在第一次超级用户登录时,我得到了:"UserProfile匹配查询不存在“。

这是完整的回溯http://dpaste.com/1035237/

我看着

process_request中的/usr/local/lib/python2.7/dist-packages/pybb/middleware.py

这里:

代码语言:javascript
运行
复制
        if request.user.is_authenticated():
        try:
            # Here we try to load profile, but can get error
            # if user created during syncdb but profile model
            # under south control. (Like pybb.Profile).
            profile = request.user.get_profile()
        except ObjectDoesNotExist:
            # Ok, we should create new profile for this user
            # and grant permissions for add posts
            user_saved(request.user, created=True)
            profile = request.user.get_profile()

但未创建超级用户的配置文件。

如何解决问题?

EN

回答 1

Stack Overflow用户

发布于 2013-03-28 20:28:44

检查settings.py中是否启用了'pybb.middleware.PybbMiddleware‘

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/15631734

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档