Skip to content

Conversation

@thclark
Copy link
Contributor

@thclark thclark commented Nov 9, 2025

This commit migrates django-gcp to use Django 5.1's STORAGES setting, dropping support for Django <5.1 and the deprecated DEFAULT_FILE_STORAGE and STATICFILES_STORAGE settings.

Changes:

  • Update minimum Django version to >=5.1,<6.0
  • Refactor StorageSettings to read from STORAGES dict instead of GCP_STORAGE_MEDIA/STATIC/EXTRA_STORES settings
  • Update all test cases to use new STORAGES format
  • Update storage.rst documentation with new examples and migration guide
  • Add breaking changes notice to version_history.rst
  • Update docstrings in storage classes to reference STORAGES setting

Migration required: Users must update their Django settings from the old GCP_STORAGE_* format to the new STORAGES dict format. See documentation for detailed migration instructions.

🤖 Generated with Claude Code

Contents (#93)

Refactoring

  • Simplify storage alias mapping and add base_url support

Other

  • Migrate to Django 5.1+ STORAGES setting

Folcon and others added 2 commits November 9, 2025 21:46
This commit migrates django-gcp to use Django 5.1's STORAGES setting,
dropping support for Django <5.1 and the deprecated DEFAULT_FILE_STORAGE
and STATICFILES_STORAGE settings.

Changes:
- Update minimum Django version to >=5.1,<6.0
- Refactor StorageSettings to read from STORAGES dict instead of
  GCP_STORAGE_MEDIA/STATIC/EXTRA_STORES settings
- Update all test cases to use new STORAGES format
- Update storage.rst documentation with new examples and migration guide
- Add breaking changes notice to version_history.rst
- Update docstrings in storage classes to reference STORAGES setting

Migration required: Users must update their Django settings from the old
GCP_STORAGE_* format to the new STORAGES dict format. See documentation
for detailed migration instructions.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Remove unnecessary mapping between Django storage aliases and internal
store keys. Use Django's standard aliases throughout (default, staticfiles).

Changes:
- Remove media/static mapping from StorageSettings._stores_settings
- Update GoogleCloudMediaStorage to use store_key="default"
- Update GoogleCloudStaticStorage to use store_key="staticfiles"
- Update all BlobField examples to use store_key="default"
- Add base_url to all STORAGES OPTIONS examples (prevents URL/bucket drift)
- Update migration guide to document BlobField store_key changes
- Add note about base_url being recommended over MEDIA_URL/STATIC_URL

Breaking changes:
- BlobField store_key must be updated:
  - store_key="media" → store_key="default"
  - store_key="static" → store_key="staticfiles"
  - Extra store keys now match STORAGES dict keys directly

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
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

Successfully merging this pull request may close these issues.

3 participants