django cms - invalid block tag endblock
Asked Answered
B

1

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.

Beltz answered 19/2, 2012 at 1:38 Comment(1)
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.Itacolumite
B
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 %}
Beltz answered 19/2, 2012 at 20:59 Comment(3)
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).Lochia
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.Beltz
Also Django-CMS itself does not like its {% cms_toolbar %} tag within a block.Halfbeak

© 2022 - 2024 — McMap. All rights reserved.