django cms 'TemplateResponse' 对象没有属性 '_headers'

django cms 'TemplateResponse' object has no attribute '_headers'

我正在关注 django-cms documentation,到目前为止我只有一个模板 home.html:

{% load cms_tags sekizai_tags %}
<html>
    <head>
        <title>{% page_attribute "page_title" %}</title>
        {% render_block "css" %}
    </head>
    <body>
        {% cms_toolbar %}
        {% placeholder "content" %}
        {% render_block "js" %}
    </body>
</html>

我的 url.py 看起来像这样:

from django.contrib import admin
from django.urls import path,  re_path, include


urlpatterns = [
    path('admin/', admin.site.urls),
    re_path(r'^', include('cms.urls')),
]

我可以登录并创建一个页面,但是当我注销并导航到“localhost:8000”时,我得到:

AttributeError at /
'TemplateResponse' object has no attribute '_headers'
Request Method: GET
Request URL:    http://localhost:8000/
Django Version: 3.2
Exception Type: AttributeError
Exception Value:    
'TemplateResponse' object has no attribute '_headers'
Exception Location: /usr/local/lib/python3.9/site-packages/cms/cache/page.py, line 84, in set_page_cache
Python Executable:  /usr/local/bin/python
Python Version: 3.9.4
Python Path:    
['/app/app',
 '/usr/local/lib/python39.zip',
 '/usr/local/lib/python3.9',
 '/usr/local/lib/python3.9/lib-dynload',
 '/usr/local/lib/python3.9/site-packages']

我不确定我这里是不是做错了什么。我想看看对于没有帐户且无法登录的人来说,该网页是什么样子的。

django-cms 3.9 中引入了对 django 3.2 的支持,因此请升级到此版本以解决此错误。