Skip to content

Using Django Compressor #262

@firesharkstudios

Description

@firesharkstudios

I'm trying to use Django Compressor (http://django-compressor.readthedocs.io/en/latest/quickstart/) with Cactus.

I've done the following...

  1. Run "pip install django-compressor" from a command line

  2. Modified the "INSTALLED_APPS" variable in site-packages/Cactus/site.py to have the value ['django_markwhat', 'compressor']

  3. Added this to my base.html...

{% load compress %}

{% compress css %}
<link rel="stylesheet" href="/static/css/one.css" type="text/css" charset="utf-8">
<style type="text/css">p { border:5px solid green;}</style>
<link rel="stylesheet" href="/static/css/two.css" type="text/css" charset="utf-8">
{% endcompress %}

Running 'cactus serve' then results in this error...

django.template.base.TemplateSyntaxError: 'compress' is not a valid tag library: ImportError raised loading compressor.templatetags.compress: cannot import name caches

Unfortunately, I'm really not that familiar with Django to troubleshoot this well. Any ideas how to fix this or otherwise get a CSS/JS minifier/combiner working with Cactus?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions