jazzband / django-pipeline

Pipeline is an asset packaging library for Django.
https://django-pipeline.readthedocs.io/
MIT License
1.52k stars 372 forks source link

Issue while using django pipeline on google-cloud engine #584

Open salujaharkirat opened 8 years ago

salujaharkirat commented 8 years ago

I have following in my settings file:-

EXTERNAL_APPS = (
    'pipeline',
)

INTERNAL_APPS = (
    'blog',
    'utils',
)

INSTALLED_APPS = EXTERNAL_APPS + INTERNAL_APPS +(
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',

)
STATICFILES_FINDERS = ('django.contrib.staticfiles.finders.FileSystemFinder',
                       'django.contrib.staticfiles.finders.AppDirectoriesFinder',
                       'pipeline.finders.PipelineFinder',)

STATICFILES_STORAGE = 'pipeline.storage.PipelineCachedStorage'
PIPELINE_CSS_COMPRESSOR = 'pipeline.compressors.yui.YUICompressor'
PIPELINE_JS_COMPRESSOR = 'pipeline.compressors.yui.YUICompressor'
PIPELINE_YUI_CSS_ARGUMENTS = ''
PIPELINE_YUI_JS_ARGUMENTS = ''
PIPELINE_YUI_BINARY = "java -Xss4096k -jar " + os.path.join(BASE_DIR, 'yuicompressor-2.4.8.jar')
PIPELINE_COMPILERS = (
     'pipeline.compilers.sass.SASSCompiler',
)

PIPELINE_CSS = {
    'wlhome': {
        'source_filenames': (
             'scss/home.scss',
        ),
        'output_filename': 'css/home.css',
    },
    'wlfontawesome': {
        'source_filenames': (
            'scss/font-awesome/font-awesome.scss',
        ),
        'output_filename': 'css/font-awesome.css',
    },
}

Now I try to use above in my stylesheets as follows:-

{% load staticfiles %}
<link href="{% static 'lib/bootstrap/dist/css/bootstrap.min.css' %}" rel="stylesheet">
<link href='https://fonts.googleapis.com/css?family=Lato:300,400,400italic,700,700italic,900' rel='stylesheet' type='text/css'>
{% load pipeline %}
{% stylesheet 'wlhome' %}

When I run the command dev_appserver.py the pages load up the fine but my stylesheet files(css/js) and not getting loaded when i use pipeline.

What i mean to say this is following works fine :-

{% load staticfiles %}
<link href="{% static 'lib/bootstrap/dist/css/bootstrap.min.css' %}" rel="stylesheet">
<link href='https://fonts.googleapis.com/css?family=Lato:300,400,400italic,700,700italic,900' rel='stylesheet' type='text/css'>
kevin-brown commented 8 years ago

Your PIPELINE_CSS is calling the stylesheetwlhome while your template is calling it wlshome. Pipeline doesn't trigger any errors when it can't find the stylesheet, which is why it's not complaining.

salujaharkirat commented 8 years ago

Sorry that was a typo, have update the details.

salujaharkirat commented 8 years ago

Following are the observations:-

If i put following in my settings file it throws error which says [Errno 78] Function not implemented.

DEBUG = True

However when is use DEBUG = False it works but the files are not loaded.