2024-10-08 18:30:48 发布
网友
尝试在Django中创建一个视图,将UserProfile连接到我的用户概要模块中。我想做些类似的事情:
@login_required def viewfunction (request): if request.user.get_profile(): << do something here >>
但这样做会出错。是否有测试用户配置文件模块存在的最佳实践?在
您可以确保您的UserProfile是通过signals创建的。这是一个相关的question。在
您可以确保您的UserProfile是通过signals创建的。这是一个相关的question。在
相关问题 更多 >
编程相关推荐