当我试图在我的request.user文件中使用它时,AttributeError: 'WSGIRequest' object has no attribute 'user'会生成一个AttributeError: 'WSGIRequest' object has no attribute 'user'错误。我做错了什么吗?def show_toolbar(request): return True
#if not request.is_ajax()
我正在使用django 1.11开发一个多语言网站,i18n_patterns
我将@login_required装饰器用于我的视图(用于在用户未登录时将其重定向到登录页面),但它不会根据当前语言将用户重定向。例如,当(未登录)用户转到/fr/ user /profile时,它将被重定向到/en/account/login?
我不想使用默认的Satchmo搜索侦听器。我已经创建了自己的搜索侦听器。# This is what I need to do...application_search.disconnect(default_product_search_listener, sender=Product)
我试图在我的应用程序的__init__.py和我的应用程序的models.py中做这件事,但这两种方法似乎都在 Satch