Skip to content

django-manifest-loader and whitenoise #50

@FranciscoKloganB

Description

@FranciscoKloganB

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
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions