Python Django decorator生成SiteProfileNotAvailable错误

Python Django decorator生成SiteProfileNotAvailable错误,python,django,decorator,Python,Django,Decorator,这里是Python(2.6)和Django(1.2)的新手,学习诀窍。考虑下面我想在方法上使用的装饰器,连同@ LogiNoWrand,如果用户尝试做需要“最小信息提供”的配置文件,则将用户重定向到配置文件完成URL。 使用模式旨在: @login_required @min_profile_required def my_view(request): # do whatever. 我目前对min_profile_required decorator的定义如下: def min_pro

这里是Python(2.6)和Django(1.2)的新手,学习诀窍。考虑下面我想在方法上使用的装饰器,连同@ LogiNoWrand,如果用户尝试做需要“最小信息提供”的配置文件,则将用户重定向到配置文件完成URL。

使用模式旨在:

@login_required
@min_profile_required
def my_view(request):
    # do whatever.
我目前对min_profile_required decorator的定义如下:

def min_profile_required(decorated_view):
    @wraps(decorated_view)
    def redirector(request, *args, **kwargs):
        if ProfileHelper.is_min_profile_complete(request.user):
            return decorated_view(request, *args, **kwargs) 
        return HttpResponseRedirect(PROFILE_COMPLETION_URL)
    return redirector
对我来说,这感觉有点像Python 101,但Django一点也不喜欢它。生成以下错误

SiteProfileNotAvailable at ...
app_label and model_name should be separated by a dot in the AUTH_PROFILE_MODULE setting
decorator是“accounts”应用程序的一部分,因此AUTH_PROFILE_模块设置不是decorator定义所属(或在其上使用)的应用程序的一部分

我觉得这应该很容易,所以我肯定遗漏了一些微妙的东西,可能与“链接”装饰师有关

非常感谢您的帮助

更新:这是我的个人资料设置

AUTH_PROFILE_MODULE = 'cta.account.models.user_profile.UserProfile'
下面提供的答案:我的配置文件模型配置不正确,应该是

AUTH_PROFILE_MODULE = 'account.UserProfile'

对我来说,似乎您在settings.py中设置了错误的配置文件。它应该是这样的:
,而这正是
django
所抱怨的。查看您的设置。

对我来说,您的settings.py中的配置文件设置似乎有误。它应该是这样的:
,而这正是
django
所抱怨的。查看您的设置。

egads!我当时正在写一个装饰程序,却忽略了眼前的东西,这让我目瞪口呆。如果你的应用程序是
myapps.account
?例如,“设置.安装的应用程序”中的“我的应用程序.帐户”egads!我当时正在写一个装饰程序,却忽略了眼前的东西,这让我目瞪口呆。如果你的应用程序是
myapps.account
?例如,“设置.安装的应用程序”中的“我的应用程序.帐户”