4

我正在编写一个基本 API,它扩展了 DetailView 以显示给定模型的最新对象。

作为网站的一部分,django-sekizai 用于 django-cms,因此所有使用的模板都需要有 sekizai 标签,但是这些不适合 API,因为它不需要 CSS/Javascript 而是输出JSON/XML/随便。

理想情况下,在编写诸如

class LatestTest(TestCase):
    def test_head_empty(self):
        c = Client()
        response = c.head(reverse(LatestView.plain_view)) 

我得到错误

TemplateSyntaxError: You must enable the 'sekizai.context_processors.sekizai' template context processor or use 'sekizai.context.SekizaiContext' to render your templates.

在执行客户端请求期间。

4

0 回答 0