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

django-manifest-loader and whitenoise #50

Open
FranciscoKloganB opened this issue Jun 13, 2021 · 1 comment
Open

django-manifest-loader and whitenoise #50

FranciscoKloganB opened this issue Jun 13, 2021 · 1 comment

Comments

@FranciscoKloganB
Copy link

FranciscoKloganB commented Jun 13, 2021

Hello developers;

I already have django-manifest-loader working on my project, but today I started to set up Whitenoise; And I am wondering if there is any wierd interaction between the two packages?

My current flow is:

  • Run Webpack with SplitChunks, compression and optimization into Django's /static/ folder;
  • Run Django collectstatic to send the contents from /static/ to STATIC_ROOT.

Set STATICFILES_STORAGE = "django.contrib.staticfiles.storage.ManifestStaticFilesStorage" (default) such that neither Django nor Whitenoise perform any sort of work on my static assets (Webpack does that for me);

Now, my problem arises from here onwards.

  • From what I got from Whitenoise docs, it expects {% static ... %} to be used.

    • Do you know if using {% manifest_match ... %} ruins Whitenoise's operation? Or there is no correlation at all.
  • Django-manifest-loader docs tell us we can set the options below:

      1. Should I set output_dir to be the path of STATIC_ROOT which happens to be an absolute path in my system?
      1. Should I set manifest_file to staticfiles.json, since it is also the approach used by Whitenoise?
MANIFEST_LOADER = {
    'output_dir': None,
    'manifest_file': 'manifest.json',
    'cache': env("SERVICE_ENV", default="dev") == "prd",
    'loader': DefaultLoader
}
@devo-wm
Copy link

devo-wm commented May 23, 2022

@FranciscoKloganB -

What'd you discover integration django-manifest-loader with whitenoise?

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

2 participants