question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

1.4.X STATICFILES_FINDERS

See original GitHub issue

I was able to prove that certain combinations of STATICFILES_FINDERS will result in no html output (no stylesheets or javascript on the rendered page).

On 1.3.X I was using:

STATICFILES_FINDERS = [
    "pipeline.finders.FileSystemFinder",
    "pipeline.finders.AppDirectoriesFinder",
    "pipeline.finders.PipelineFinder",
    "pipeline.finders.CachedFileFinder",
]

After upgrading to 1.4.x and updating my templates to use the new tags pipeline, stylesheet, javascript I discovered the problem and found that using the following works:

STATICFILES_FINDERS = [
    "django.contrib.staticfiles.finders.FileSystemFinder",
    "django.contrib.staticfiles.finders.AppDirectoriesFinder",
    "pipeline.finders.PipelineFinder",
    "pipeline.finders.CachedFileFinder",
]

Issue Analytics

  • State:open
  • Created 9 years ago
  • Comments:18 (5 by maintainers)

github_iconTop GitHub Comments

5reactions
emyllercommented, Jun 17, 2016

Following up: I’ve just read the finder.py sourcecode and found this:

class FileSystemFinder(PatternFilterMixin, DjangoFileSystemFinder):
    """
    Like FileSystemFinder, but doesn't return any additional ignored patterns
    This allows us to concentrate/compress our components without dragging
    the raw versions in too.
    """
    ignore_patterns = [
        '*.js',
        '*.css',
        '*.less',
        '*.scss',
        '*.styl',

If FileSystemFinder is supposed to ignore CSS, SCSS, JavaScript, etc files, how could it ever find the files to work with? Either it is very wrong or we’re all missing the point of how/when to use it.

0reactions
vskhcommented, Mar 30, 2017

Including pipeline.finders.AppDirectoriesFinder into STATICFILES_FINDERS breaks collectstatic for me as well. While source says that it excludes certain types of files on purpose to avoid copying them to STATIC_ROOT, I did not find any trace of logic in storage to resolve source files when compiling configured packages. As of version 1.6.11 I used for debugging it just follows the regular logic of static files storage, i.e. prepending requested files with STATIC_ROOT meaning that although it excludes files from collection it still looks for them in STATIC_ROOT 😦

Read more comments on GitHub >

github_iconTop Results From Across the Web

The staticfiles app — Django 1.4.6 documentation
The list of finder backends that know how to find static files in various locations. The default will find files stored in the...
Read more >
9. Integrating a third-party application — django cms 3.8.0 ...
Add the boilerplates static files finder to STATICFILES_FINDERS , immediately before django.contrib.staticfiles.finders.AppDirectoriesFinder :.
Read more >
Pipeline Documentation - Read the Docs
Add the PipelineFinder to STATICFILES_FINDERS. STATICFILES_FINDERS = ( ... To upgrade to pipeline 1.4, you will need to follow theses steps:.
Read more >
The staticfiles app - Django documentation
STATICFILES_FINDERS. Management Commands¶. django.contrib.staticfiles exposes three management commands.
Read more >
Django: serving static file on debug=false - Stack Overflow
ls -la shows drwxr-xr-x. On my pc im not under htaccess, not that i know of. and on production, its on Heroku. –...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found