Add node_modules to STATICFILES_DIRS when STATICFILES_USE_NPM is enabled - #1291
Open
James-Dolinar wants to merge 2 commits into
Open
Add node_modules to STATICFILES_DIRS when STATICFILES_USE_NPM is enabled#1291James-Dolinar wants to merge 2 commits into
James-Dolinar wants to merge 2 commits into
Conversation
- settings.py only appended node_modules to STATICFILES_DIRS when STATICFILES_USE_NPM was set under TETHYS_PORTAL_CONFIG - The generic settings loader later applies any remaining top-level keys to the Django settings module, so STATICFILES_USE_NPM declared at the top level of the `settings` block would enable NPM mode, switching templates from CDN to /static/ URLs without ever adding node_modules to the static paths - The portal then requested local JavaScript and CSS dependencies that were never served, returning 404s and leaving the portal unstyled - Also check for STATICFILES_USE_NPM at the top level so the node_modules path is added whenever NPM mode is on, regardless of where it's declared
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes the issue where putting
STATICFILES_USE_NPM: trueunder settings inportal_config.ymlcauses the tethys portal to be unable to find the css and js static files.tethys_portal/settings.pywas checking forSTATICFILES_USE_NPMunderTETHYS_PORTAL_CONFIGonly when adding the static files paths resulting in the path not being added whenSTATICFILES_USE_NPMis located at the top level. The setting still applied in this scenario resulting in the portal not being able to find the static files.Putting
STATICFILES_USE_NPMeither under the top level orTETHYS_PORTAL_CONFIGboth properly add the static files path.Changes Made to Code
STATICFILES_USE_NPMunder the top level when adding the static files pathRelated PRs, Issues, and Discussions
Additional Notes
Quality Checks