← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1734634] [NEW] OpenStack not compiling CSS with Django-Compressor

 

Public bug reported:

I've setup OpenStack in dev environment for customizing layout for
testing. I can't compress CSS to change default layout for Horizon
Dashboard as I am getting the following:

Error:

Error during template rendering

In template
/home/mike/horizon/horizon/openstack_dashboard/templates/_stylesheets.html,
error at line 4.

{% load compress %}
	{% load themes %}
	
	{% compress css %}
	<link href='{{ STATIC_URL }}horizon/lib/bootstrap_datepicker/datepicker3.css' type='text/css' media='screen' rel='stylesheet' />
	<link href='{{ STATIC_URL }}horizon/lib/rickshaw/rickshaw.css' type='text/css' media='screen' rel='stylesheet' />
	<link href='{{ STATIC_URL }}horizon/custom.css' type='text/css' media='screen' rel='stylesheet' />
	{% endcompress %}
	
	
	{% current_theme as current_theme %}
	{% theme_dir as theme_dir %}
	
        {% comment %}
My Openstack settings for offline compress are:

HORIZON_COMPRESS_OFFLINE_CONTEXT_BASE = {
    'WEBROOT': WEBROOT,
    'STATIC_URL': STATIC_URL,
    'HORIZON_CONFIG': HORIZON_CONFIG,
    'NG_TEMPLATE_CACHE_AGE': NG_TEMPLATE_CACHE_AGE,
}

When I try to compress it from terminal with "python manage.py compress"
I get this error:

      CommandError: Offline compression is disabled. Set
COMPRESS_OFFLINE or use the --force to override.


When I try to use "python manage.py compress --force" I get:

        python manage.py compress --force
        Found 'compress' tags in:
	/home/mhashmi/horizon/horizon/openstack_dashboard/templates/horizon/_scripts.html
	/home/mhashmi/horizon/horizon/openstack_dashboard/templates/_stylesheets.html
	/home/mhashmi/horizon/horizon/openstack_dashboard/templates/horizon/_conf.html
	/home/mhashmi/horizon/horizon/openstack_dashboard/templates/serial_console.html
        Compressing... CommandError: An error occurred during rendering 
       /home/mhashmi/horizon/horizon/openstack_dashboard/templates/_stylesheets.html: 
       'horizon/custom.css' could not be found in the COMPRESS_ROOT 
       '/home/mhashmi/horizon/horizon/static' or with staticfiles.

I simply added css in _stylesheet.html and then created a custom.css in "scss/custom.css".
Please advise.

** Affects: horizon
     Importance: Undecided
         Status: New


** Tags: horizon-core

** Tags added: horizon-core

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Dashboard (Horizon).
https://bugs.launchpad.net/bugs/1734634

Title:
  OpenStack not compiling CSS with Django-Compressor

Status in OpenStack Dashboard (Horizon):
  New

Bug description:
  I've setup OpenStack in dev environment for customizing layout for
  testing. I can't compress CSS to change default layout for Horizon
  Dashboard as I am getting the following:

  Error:

  Error during template rendering

  In template
  /home/mike/horizon/horizon/openstack_dashboard/templates/_stylesheets.html,
  error at line 4.

  {% load compress %}
  	{% load themes %}
  	
  	{% compress css %}
  	<link href='{{ STATIC_URL }}horizon/lib/bootstrap_datepicker/datepicker3.css' type='text/css' media='screen' rel='stylesheet' />
  	<link href='{{ STATIC_URL }}horizon/lib/rickshaw/rickshaw.css' type='text/css' media='screen' rel='stylesheet' />
  	<link href='{{ STATIC_URL }}horizon/custom.css' type='text/css' media='screen' rel='stylesheet' />
  	{% endcompress %}
  	
  	
  	{% current_theme as current_theme %}
  	{% theme_dir as theme_dir %}
  	
          {% comment %}
  My Openstack settings for offline compress are:

  HORIZON_COMPRESS_OFFLINE_CONTEXT_BASE = {
      'WEBROOT': WEBROOT,
      'STATIC_URL': STATIC_URL,
      'HORIZON_CONFIG': HORIZON_CONFIG,
      'NG_TEMPLATE_CACHE_AGE': NG_TEMPLATE_CACHE_AGE,
  }

  When I try to compress it from terminal with "python manage.py
  compress" I get this error:

        CommandError: Offline compression is disabled. Set
  COMPRESS_OFFLINE or use the --force to override.

  
  When I try to use "python manage.py compress --force" I get:

          python manage.py compress --force
          Found 'compress' tags in:
  	/home/mhashmi/horizon/horizon/openstack_dashboard/templates/horizon/_scripts.html
  	/home/mhashmi/horizon/horizon/openstack_dashboard/templates/_stylesheets.html
  	/home/mhashmi/horizon/horizon/openstack_dashboard/templates/horizon/_conf.html
  	/home/mhashmi/horizon/horizon/openstack_dashboard/templates/serial_console.html
          Compressing... CommandError: An error occurred during rendering 
         /home/mhashmi/horizon/horizon/openstack_dashboard/templates/_stylesheets.html: 
         'horizon/custom.css' could not be found in the COMPRESS_ROOT 
         '/home/mhashmi/horizon/horizon/static' or with staticfiles.

  I simply added css in _stylesheet.html and then created a custom.css in "scss/custom.css".
  Please advise.

To manage notifications about this bug go to:
https://bugs.launchpad.net/horizon/+bug/1734634/+subscriptions


Follow ups