Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Readme documentation should include INLINECSS_CSS_LOADER setting option details #55

Open
michaeljtbrooks opened this issue Feb 18, 2021 · 0 comments

Comments

@michaeljtbrooks
Copy link

michaeljtbrooks commented Feb 18, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant