django-cms: cms check command confused by Sekizai with_data block

Description

If the <head> section of a CMS page template (usually a base template it’s extended from) has a {% with_data %} block in it, ./manage.py cms check will erroneously generate an error.

Steps to reproduce

Put one of the following in the <head> section of a template that originally passes ./manage.py cms check, and run ./manage.py cms check:

{% with_data "google-fonts" as fonts %}{% if fonts %}
<link href="https://fonts.googleapis.com/css?family={{ fonts|join:',' }}" rel="stylesheet">
{% endif %}{% end_with_data %}

or

{% with_data "google-fonts" as fonts %}{% end_with_data %}

I used a Django project generated by Django-CMS Installer for testing.

Expected behaviour

********************************
Checking django CMS installation
********************************

Sekizai
=======

  - Sekizai is installed [OK]
  - Sekizai template context processor is installed [OK]
  - Sekizai namespaces 'js' and 'css' found in 'fullwidth.html' [OK]
  - Sekizai namespaces 'js' and 'css' found in 'sidebar_left.html' [OK]
  - Sekizai namespaces 'js' and 'css' found in 'sidebar_right.html' [OK]

Sekizai configuration okay [OK]

Actual behaviour

********************************
Checking django CMS installation
********************************

Sekizai
=======

  - Sekizai is installed [OK]
  - Sekizai template context processor is installed [OK]
  - Sekizai namespaces 'js' and 'css' not found in 'fullwidth.html' [ERROR]
  - Sekizai namespaces 'js' and 'css' not found in 'sidebar_left.html' [ERROR]
  - Sekizai namespaces 'js' and 'css' not found in 'sidebar_right.html' [ERROR]

Sekizai configuration has errors [ERROR]

Additional information

Python version 3.6, Django 2.2, Django CMS 3.7.4

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 20 (4 by maintainers)

Most upvoted comments

P.S. If anyone else find this on Google and needs a way to skip the check until it works, put this in your settings.py:

SEKIZAI_IGNORE_VALIDATION = True

Stale or not, it’s still not fixed in sekizai.

That documentation’s entire coverage of the cms check command:

cms check

Checks your configuration and environment.

Django itself, meanwhile, has a good example of the kind of thing I’m looking for.

Anyway, I managed to determine it’s a sekizai bug, so you can breathe easy.