Additional django-sekizai for API

I am writing a basic API where it extends the DetailView to display the last object for a given model.

As part of the site, django-sekizai is used for django-cms and as a result all templates used must have sekizai tags, however they are not suitable for the API since it does not need CSS / Javascript but outputs JSON / XML / Whatever.

Ideally, I would like the sekizai context processor not to execute for that view when writing tests like

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

      

I am getting the error

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

      

During the execution of a client request.

+3


source to share





All Articles