Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

django pipeline breaks admin when DEBUG=False

here is the settings for css

PIPELINE_CSS = {
    'base': {
        'source_filenames': (
            'scss/core.scss',
        ),
        'output_filename': 'css/min.css',
    },
   'ie8': {
        'source_filenames': (
            'css/ie-8-overrides.css',       
        ),
        'output_filename': 'css/ie8.css',
    },
}

Somehow it complains about:

ValueError: The file 'admin/css/base.css' could not be found with <pipeline.storage.PipelineCachedStorage object at 0x10c34add0>.
like image 272
James Lin Avatar asked Oct 20 '25 08:10

James Lin


1 Answers

Found it, the STATICFILES_FINDERS didn't have the built-in django one, so when collecting static files it wasn't copying the css and js from admin.

STATICFILES_FINDERS = (
    'pipeline.finders.FileSystemFinder',
    'pipeline.finders.AppDirectoriesFinder',
    'pipeline.finders.PipelineFinder',
    'pipeline.finders.CachedFileFinder',
    'django.contrib.staticfiles.finders.AppDirectoriesFinder', # added this and worked
)
like image 193
James Lin Avatar answered Oct 22 '25 04:10

James Lin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!