Automatically run Django's collectstatic
command
#108
Merged
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.
The classic Heroku Python buildpack automatically runs the Django
collectstatic
command:https://github.com/heroku/heroku-buildpack-python/blob/main/bin/steps/collectstatic
This adds equivalent support, with a couple of improvements:
manage.py
files are now supported, as requested in Fix Django sites with manage.py symlinks or similar unconventional configurations heroku-buildpack-python#972.There is currently no way to force disable the feature (beyond removing
django.contrib.staticfiles
fromINSTALLED_APPS
in the app's Django config, or removing themanage.py
script). Supporting this depends on us deciding how best to handle buildpack options, so will be added later, in #109.The build log output and error messages are fairly reasonable already (and a significant improvement over the classic buildpack), and will be further polished as part of the future build output overhaul.
The implementation uses the new
utils::run_command_and_capture_output
added in #106.See:
Fixes #5.
GUS-W-9538294.