19

I am trying to get django cms working with pinax but for some reason runserver gives me this: http://dpaste.com/704936/

Towards the end:

.... 
 File "/home/tux/VirtualEnvs/NewAvePinaxBootstrap/lib/python2.7/site-packages/sekizai/templatetags/sekizai_tags.py", line 43, in parse_blocks
    self.blocks['nodelist'] = self.parser.parse()
  File "/home/tux/VirtualEnvs/NewAvePinaxBootstrap/lib/python2.7/site-packages/django/template/base.py", line 237, in parse
    self.invalid_block_tag(token, command, parse_until)
  File "/home/tux/VirtualEnvs/NewAvePinaxBootstrap/lib/python2.7/site-packages/django/template/base.py", line 291, in invalid_block_tag
    raise self.error(token, "Invalid block tag: '%s'" % command)
django.template.base.TemplateSyntaxError: Invalid block tag: 'endblock'

How is endblock an invalid block tag? When I disable 'cms' from my INSTALLED_APPS, the error goes away. So, I think it's django cms's fault for some reason or is this a more general django question? Does django cms not work with pinax? I followed the tutorial on the django cms docs and made/copied their sample template_1.

Christian
  • 25,249
  • 40
  • 134
  • 225
Justin M
  • 1,065
  • 2
  • 10
  • 15
  • Without seeing your template code it's hard to tell, but check you are a) including the middleware and context processors in your settings.py, and that any templates which use custom tags include a `{% load cms_tags %}` line at the beginning. – Mikesname Feb 19 '12 at 15:51

1 Answers1

31

I figured it out. The problem was in the template. I was unaware that sekizai tags couldn't work inside block tags. From the sekizai documentation:

The tag must be in the base template. It cannot be used in an included template. The tag must not be placed within a block tag (a template tag with an end tag, for example {% block name %}...{% endblock %}).

For future reference to anyone who may encounter this. This was the offending code:

{% block extra_style %}{% render_block "css" %}{% endblock %}
istruble
  • 13,363
  • 2
  • 47
  • 52
Justin M
  • 1,065
  • 2
  • 10
  • 15
  • Great that you managed to answer your own question. You might want to try to add a little bit more details to the question about what you where using (eg. django-cms and sekizai are both both in INSTALLED_APPS and sekizai.context_processors.sekizai is in TEMPATE_CONTEXT_PROCESSORS). – istruble Feb 19 '12 at 21:10
  • 1
    Will do! Thank you. I didn't really know where my problem was originating, so I didn't really know what exactly was relevant. I will add more concrete details to my future questions. – Justin M Feb 19 '12 at 22:23
  • 3
    Also Django-CMS itself does not like its `{% cms_toolbar %}` tag within a block. – che May 13 '15 at 10:20