Skip to content

Readme documentation should include INLINECSS_CSS_LOADER setting option details #55

@michaeljtbrooks

Description

@michaeljtbrooks

I ran into the problem with the {% inlinecss %} tag being unable to open CSS files in production test environments. The cause was that the standard CSS loader is looking in the collectstatic destination directory. In some setups, the collectstatic directory is only accessible via http calls via the webserver, and not to the WSGI Python workers that run the Django code. Really since the CSS is being read by the Django Python workers in {% inlinecss %}, the CSS should be the source static directories rather than the collectstatic dir.

I was able to fix this by looking at the source code and finding you'd already written the class I was otherwise going to write (django_inlinecss.css_loaders.StaticfilesFinderCSSLoader)!

I spotted the conf getattr(settings, INLINE_CSS_LOADER) line, so fixed it all with:
INLINECSS_CSS_LOADER = "django_inlinecss.css_loaders.StaticfilesFinderCSSLoader"

I think this should be included in the Readme so users who struggle with IOerrors in production / tests know how to change the behaviour.


Relates to #54, but this is specifically for the Readme.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions