[Django] #27541: Provide hooks to override manifest file storage in ManifestFilesMixin

56 views
Skip to first unread message

Django

unread,
Nov 27, 2016, 3:47:06 PM11/27/16
to django-...@googlegroups.com
#27541: Provide hooks to override manifest file storage in ManifestFilesMixin
-----------------------------------------+------------------------
Reporter: lopopolo | Owner: nobody
Type: Uncategorized | Status: new
Component: Uncategorized | Version: 1.10
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-----------------------------------------+------------------------
My use case is that I would like to run collectstatic and store static
assets in S3. However, I would like to store staticfiles.json locally so I
can bake it into my deployment artifact.

It seems the only way to do this right now is to create a custom mixin
[https://github.com/klis87/django-cloudinary-
storage/blob/711af26702645dc42f2a3e59d69e37e690def0bf/cloudinary_storage/storage.py#L199
like this one] and override read_manifest and save_manifest to use a
custom storage.

It seems the current behavior can be retained by using a FileSystemStorage
with location = settings.STATIC_ROOT (aka self). Can we add a
manifest_storage as an overridable property?

--
Ticket URL: <https://code.djangoproject.com/ticket/27541>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Nov 27, 2016, 3:52:42 PM11/27/16
to django-...@googlegroups.com
#27541: Provide hooks to override manifest file storage in ManifestFilesMixin
-------------------------------------+-------------------------------------
Reporter: Ryan Lopopolo | Owner: nobody
Type: New feature | Status: new
Component: contrib.staticfiles | Version: 1.10
Severity: Normal | Resolution:

Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Ryan Lopopolo):

* component: Uncategorized => contrib.staticfiles
* type: Uncategorized => New feature


--
Ticket URL: <https://code.djangoproject.com/ticket/27541#comment:1>

Django

unread,
Nov 28, 2016, 6:51:01 AM11/28/16
to django-...@googlegroups.com
#27541: Provide hooks to override manifest file storage in ManifestFilesMixin
-------------------------------------+-------------------------------------
Reporter: Ryan Lopopolo | Owner: nobody
Type: New feature | Status: new
Component: contrib.staticfiles | Version: 1.10
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tim Graham):

I'm not sure if I understand the suggestion, can you provide a patch? Will
it be backwards compatible?

--
Ticket URL: <https://code.djangoproject.com/ticket/27541#comment:2>

Django

unread,
Nov 28, 2016, 6:54:08 PM11/28/16
to django-...@googlegroups.com
#27541: Provide hooks to override manifest file storage in ManifestFilesMixin
-------------------------------------+-------------------------------------
Reporter: Ryan Lopopolo | Owner: nobody
Type: New feature | Status: new
Component: contrib.staticfiles | Version: 1.10
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Ryan Lopopolo):

* Attachment "manifest_storage.patch" added.

manifest_storage indirection

Django

unread,
Nov 28, 2016, 6:55:15 PM11/28/16
to django-...@googlegroups.com
#27541: Provide hooks to override manifest file storage in ManifestFilesMixin
-------------------------------------+-------------------------------------
Reporter: Ryan Lopopolo | Owner: nobody
Type: New feature | Status: new
Component: contrib.staticfiles | Version: 1.10
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Ryan Lopopolo):

My intent is to add a layer of indirection to allow the manifest file to
be saved to a separate storage backend than the static files themselves.

I've attached a patch. It should be backwards compatible.

--
Ticket URL: <https://code.djangoproject.com/ticket/27541#comment:3>

Django

unread,
Nov 28, 2016, 6:59:59 PM11/28/16
to django-...@googlegroups.com
#27541: Provide hooks to override manifest file storage in ManifestFilesMixin
-------------------------------------+-------------------------------------
Reporter: Ryan Lopopolo | Owner: nobody
Type: New feature | Status: new
Component: contrib.staticfiles | Version: 1.10
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Ryan Lopopolo):

* Attachment "manifest_storage.patch" added.

manifest_storage indirection

--

Django

unread,
Nov 28, 2016, 10:22:58 PM11/28/16
to django-...@googlegroups.com
#27541: Provide hooks to override manifest file storage in ManifestFilesMixin
-------------------------------------+-------------------------------------
Reporter: Ryan Lopopolo | Owner: nobody
Type: New feature | Status: new
Component: contrib.staticfiles | Version: 1.10
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Ryan Lopopolo):

* Attachment "manifest_storage.patch" added.

manifest_storage indirection

--

Django

unread,
Nov 28, 2016, 10:24:03 PM11/28/16
to django-...@googlegroups.com
#27541: Provide hooks to override manifest file storage in ManifestFilesMixin
-------------------------------------+-------------------------------------
Reporter: Ryan Lopopolo | Owner: nobody
Type: New feature | Status: new
Component: contrib.staticfiles | Version: 1.10
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Ryan Lopopolo):

The latest patch passes all tests when running

../venv/bin/python ./runtests.py staticfiles_tests.test_storage

I could not get the whole staticfiles suite to run

--
Ticket URL: <https://code.djangoproject.com/ticket/27541#comment:4>

Django

unread,
Nov 30, 2016, 12:04:13 PM11/30/16
to django-...@googlegroups.com
#27541: Provide hooks to override manifest file storage in ManifestFilesMixin
-------------------------------------+------------------------------------

Reporter: Ryan Lopopolo | Owner: nobody
Type: New feature | Status: new
Component: contrib.staticfiles | Version: 1.10
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 1 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+------------------------------------
Changes (by Tim Graham):

* needs_docs: 0 => 1
* has_patch: 0 => 1
* needs_tests: 0 => 1
* stage: Unreviewed => Accepted


Comment:

It might be fine, I've not done much work with that code to say if there
might be a better design. Anyway, at least docs and tests are also needed.

--
Ticket URL: <https://code.djangoproject.com/ticket/27541#comment:5>

Django

unread,
Nov 17, 2020, 4:46:39 AM11/17/20
to django-...@googlegroups.com
#27541: Provide hooks to override manifest file storage in ManifestFilesMixin
-------------------------------------+------------------------------------
Reporter: Ryan Lopopolo | Owner: nobody
Type: New feature | Status: new
Component: contrib.staticfiles | Version: 1.10
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 1 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+------------------------------------

Comment (by Carlton Gibson):

I'm going to close this as a duplicate of #27590 — both tickets are asking
to allow configuration of where to store the manifest.

--
Ticket URL: <https://code.djangoproject.com/ticket/27541#comment:6>

Django

unread,
Aug 5, 2021, 5:19:59 AM8/5/21
to django-...@googlegroups.com
#27541: Provide hooks to override manifest file storage in ManifestFilesMixin
-------------------------------------+-------------------------------------

Reporter: Ryan Lopopolo | Owner: nobody
Type: New feature | Status: closed
Component: contrib.staticfiles | Version: 1.10
Severity: Normal | Resolution: duplicate

Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 1 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* status: new => closed
* resolution: => duplicate


Comment:

Duplicate of #27590.

--
Ticket URL: <https://code.djangoproject.com/ticket/27541#comment:7>

Reply all
Reply to author
Forward
0 new messages