4

I'm writing a basic API, where it extends a DetailView to display the latest object for a given model.

As part of the site, django-sekizai is used for django-cms and as a result all used templates need to have the sekizai tags, however these aren't appropriate for an API as it doesn't need CSS/Javascript but rather outputs JSON/XML/Whatever.

Ideally I'd like for sekizai's context processor to not execute for this view, when writing tests such as

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

I get 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 the client request.

Daniel Rucci
  • 2,822
  • 2
  • 32
  • 42
Peter Brooks
  • 1,170
  • 9
  • 23
  • 2
    Did you add in TEMPLATE_CONTEXT_PROCESSORS 'sekizai.context_processors.sekizai'? I also added but I still have the same problem. Thanks! – Daviddd May 06 '13 at 06:51

0 Answers0