문제

I am using django-compressor to compress css files.

I did as it was explained in http://django-compressor.readthedocs.org/en/latest/quickstart/

I changed my template file as follows:

{% load staticfiles %}
{% load compress %}

<!DOCTYPE html>
<html lang="en">
  <head>
    {% compress css %}
    <link href="{% static "crsq/css/zippednewsapp/bootstrap.readable.min.css" %}" rel="stylesheet">
    <link href="{% static "crsq/css/zippednewsapp/zippednewsapp.css" %}" rel="stylesheet">
    <link rel="stylesheet" href="{% static "crsq/css/zippednewsapp/typeahead.css" %}"/>
    {% endcompress %}
  </head>

.....

I do not see any change what so ever. No error. The files are not compressed. How do I change this?

In my settings file:

DEBUG = False
TEMPLATE_DEBUG = False

STATIC_ROOT = ''

STATIC_URL = '/static/'

STATICFILES_DIRS = (
)

STATICFILES_FINDERS = (
    'django.contrib.staticfiles.finders.FileSystemFinder',
    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
    'compressor.finders.CompressorFinder',
)

Appreciate any help. Thanks

도움이 되었습니까?

해결책

If html didn't change, I'd check server restart after the changes.

If not, you can increase logging level and see what does the compressor module print into the logs.

Also,the compressor should run under a user with enough privileges to create files and folders under COMPRESS_ROOT (which defaults to STATIC_ROOT)

Regards

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top