Skip to content

Stop using --link when running Django collectstatic#339

Merged
edmorley merged 1 commit into
mainfrom
django-collectstatic-no-link
Mar 11, 2025
Merged

Stop using --link when running Django collectstatic#339
edmorley merged 1 commit into
mainfrom
django-collectstatic-no-link

Conversation

@edmorley
Copy link
Copy Markdown
Member

@edmorley edmorley commented Mar 11, 2025

Since:

  • It causes collectstatic to fail if the app is using a Django remote storage backend (such as one that stores static assets on S3).
  • Using --link provides little benefit to apps using local storage when using WhiteNoise configured with WHITENOISE_KEEP_ONLY_HASHED_FILES=True (as the Python Getting Started Guide does)

See:

Fixes #328.
GUS-W-17799386.

@edmorley edmorley self-assigned this Mar 11, 2025
@edmorley edmorley added the bug Something isn't working label Mar 11, 2025
Since:
- It causes collectstatic to fail if the app is using a Django
  remote storage backend (such as one that stores static
  assets on S3).
- Using `--link` provides little benefit to apps using local
  storage when using WhiteNoise configured with
  `WHITENOISE_KEEP_ONLY_HASHED_FILES=True`
  (as the Python Getting Started Guide does)

See:
- #328
- https://docs.djangoproject.com/en/5.1/ref/contrib/staticfiles/#collectstatic

Fixes #328.
GUS-W-17799386.
@edmorley edmorley force-pushed the django-collectstatic-no-link branch from c5c3dff to 6b83777 Compare March 11, 2025 18:02
@edmorley edmorley marked this pull request as ready for review March 11, 2025 19:05
@edmorley edmorley requested a review from a team as a code owner March 11, 2025 19:05
@edmorley edmorley enabled auto-merge (squash) March 11, 2025 19:07
@edmorley edmorley merged commit 97d3a47 into main Mar 11, 2025
@edmorley edmorley deleted the django-collectstatic-no-link branch March 11, 2025 22:24
heroku-linguist Bot added a commit that referenced this pull request Mar 11, 2025
## heroku/python

### Changed

- Stopped using `--link` when running Django's collectstatic command, since it doesn't work with remote storage backends. ([#339](#339))
heroku-linguist Bot added a commit that referenced this pull request Mar 11, 2025
## heroku/python

### Changed

- Stopped using `--link` when running Django's collectstatic command, since it doesn't work with remote storage backends. ([#339](#339))

Co-authored-by: heroku-linguist[bot] <136119646+heroku-linguist[bot]@users.noreply.github.com>
heroku-linguist Bot added a commit to heroku/cnb-builder-images that referenced this pull request Mar 11, 2025
## heroku/python

### Changed

- Stopped using `--link` when running Django's collectstatic command, since it doesn't work with remote storage backends. ([#339](heroku/buildpacks-python#339))
heroku-linguist Bot added a commit to heroku/cnb-builder-images that referenced this pull request Mar 11, 2025
## heroku/python

### Changed

- Stopped using `--link` when running Django's collectstatic command, since it doesn't work with remote storage backends. ([#339](heroku/buildpacks-python#339))

Co-authored-by: heroku-linguist[bot] <136119646+heroku-linguist[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Django collectstatic fails when using a remote storage backend due to use of --link

2 participants