Re: [Django] #27590: Allow configuration of where to save staticfiles manifest.

2021-08-06 Thread Django
#27590: Allow configuration of where to save staticfiles manifest.
-+-
 Reporter:  David Sanders|Owner:  Jarosław
 |  Wygoda
 Type:  New feature  |   Status:  closed
Component:  contrib.staticfiles  |  Version:  dev
 Severity:  Normal   |   Resolution:  fixed
 Keywords:   | Triage Stage:  Ready for
 |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Mariusz Felisiak ):

 * status:  assigned => closed
 * resolution:   => fixed


Comment:

 In [changeset:"d3c4696596822281c0a5d4b9e3ee27732a4ce092" d3c4696]:
 {{{
 #!CommitTicketReference repository=""
 revision="d3c4696596822281c0a5d4b9e3ee27732a4ce092"
 Fixed #27590 -- Allowed customizing a manifest file storage in
 ManifestFilesMixin.
 }}}

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/068.8b8549926c5f5306b41d412568453636%40djangoproject.com.


Re: [Django] #27590: Allow configuration of where to save staticfiles manifest.

2021-08-05 Thread Django
#27590: Allow configuration of where to save staticfiles manifest.
-+-
 Reporter:  David Sanders|Owner:  Jarosław
 |  Wygoda
 Type:  New feature  |   Status:  assigned
Component:  contrib.staticfiles  |  Version:  dev
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Ready for
 |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Mariusz Felisiak):

 * stage:  Accepted => Ready for checkin


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/068.6712d22bcac65b8bb40c566bbf874f96%40djangoproject.com.


Re: [Django] #27590: Allow configuration of where to save staticfiles manifest.

2021-06-02 Thread Django
#27590: Allow configuration of where to save staticfiles manifest.
-+-
 Reporter:  David Sanders|Owner:  Jarosław
 |  Wygoda
 Type:  New feature  |   Status:  assigned
Component:  contrib.staticfiles  |  Version:  dev
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Jacob Walls):

 * needs_better_patch:  1 => 0
 * version:  1.10 => dev
 * needs_docs:  1 => 0


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/068.71f7bba042370da69349f1847d38429f%40djangoproject.com.


Re: [Django] #27590: Allow configuration of where to save staticfiles manifest.

2021-06-02 Thread Django
#27590: Allow configuration of where to save staticfiles manifest.
-+-
 Reporter:  David Sanders|Owner:  Jarosław
 |  Wygoda
 Type:  New feature  |   Status:  assigned
Component:  contrib.staticfiles  |  Version:  1.10
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  1
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Jacob Walls):

 * type:  Cleanup/optimization => New feature


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/068.194d154271ef68274b53fa2036be4bb6%40djangoproject.com.


Re: [Django] #27590: Allow configuration of where to save staticfiles manifest.

2020-11-24 Thread Django
#27590: Allow configuration of where to save staticfiles manifest.
-+-
 Reporter:  David Sanders|Owner:  Jarosław
 Type:   |  Wygoda
  Cleanup/optimization   |   Status:  assigned
Component:  contrib.staticfiles  |  Version:  1.10
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  1
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Carlton Gibson):

 The breaking change is important. We can't just bring that in.

 Adding a setting **might** be OK — folks could set it to STATIC_ROOT to
 get the old value — BUT #26029 is about restructuring all this anyway: to
 add a setting only to need to deprecate it is too much churn. (Even
 assuming we'd take the hit on breaking people's deployments as they failed
 to make the changes in time.)

 Adding the manifest_storage kwarg (taking a storage) is small and simple.
 That's why I think we should advance with it. Later, when #26029 comes
 along, we can review the exact API we want there — we can either configure
 `manifest_storage` directly in the settings, or allow a path there that
 will used internally — but that's a separate conversation (one we can
 defer).

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/068.91a61230dd2dac09925f7472f18e8244%40djangoproject.com.


Re: [Django] #27590: Allow configuration of where to save staticfiles manifest.

2020-11-23 Thread Django
#27590: Allow configuration of where to save staticfiles manifest.
-+-
 Reporter:  David Sanders|Owner:  Jarosław
 Type:   |  Wygoda
  Cleanup/optimization   |   Status:  assigned
Component:  contrib.staticfiles  |  Version:  1.10
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  1
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-

Comment (by David Sanders):

 Kevin, I think you're neglecting how `collectstatic` is used, and has been
 historically used. Changing the default to storing the manifest in the
 codebase would be a breaking change for some users. The
 `ManifestFilesMixin` hashes files based on content, and the content is
 going to depend on people's configurations, and the content will likely
 differ depending on the settings used between development and production.
 Minifying JS for production is a common use-case, but not for development.
 If the manifest by default lives in the codebase, it would both need to be
 re-generated after any changes (change in development process), and would
 end up with the output for the development environment. Django would
 probably need to give a large caveat to ignore the file for source control
 otherwise users will shoot themselves in the foot quite often.

 The issue I originally brought up with `S3BotoStorage` is that
 `ManifestFilesMixin` is a mixin, so adding that to a storage class like
 `S3BotoStorage` means it will read and write the manifest from that
 storage - in that case from S3. Changing the behavior so that the manifest
 doesn't use that storage class could be unintuitive for users. It will
 have particular ramifications to how and when they call `collectstatic`
 for their deployments - when using a class like `S3BotoStorage` that sends
 the files to remote storage, they may not be currently invoking
 `collectstatic` at a point where it can write out the manifest into the
 codebase and have that change be persistent and make it into the
 deployment of the code to production as well. So there'd be a lot of
 assumptions about how people are currently using it.

 I haven't looked at this issue in 4 years, so that's going from memory.
 But I don't believe there's a simple "change the default location"
 solution given how many ways `collectstatic` might be used - you're
 probably going to break it for somebody. If there were a clear win here I
 think I probably would have just made a PR instead of this issue. :-) I
 spent a decent amount of time thinking through the problem before punting
 it to this issue. I fear if you make it a hard-coded change to the
 default, even with a deprecation cycle you'll end up with people coming
 out of the woodwork on why they *have* to have it working the way it
 originally did, and if there's no configuration ability then you've got a
 problem there.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/068.f1b882619dca35f4db7fe5b35f4496de%40djangoproject.com.


Re: [Django] #27590: Allow configuration of where to save staticfiles manifest.

2020-11-21 Thread Django
#27590: Allow configuration of where to save staticfiles manifest.
-+-
 Reporter:  David Sanders|Owner:  Jarosław
 Type:   |  Wygoda
  Cleanup/optimization   |   Status:  assigned
Component:  contrib.staticfiles  |  Version:  1.10
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  1
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Kevin Christopher Henry):

 If we take a step back, the problem here isn't that there's no way to
 configure the manifest location, it's that the standard location for it is
 bad. That's the reason people want to change it. So rather than making it
 ''possible'' for people to avoid the problem by introducing a new
 customization mechanism, we should just fix the standard value so that no
 one has the problem in the first place.

 If we accept that the default manifest location needs to change at some
 point then there will inevitably be a backwards incompatibility.

 One way to address that would be to just document in the release notes
 that people using `ManifestStaticFilesStorage` need to run `collectstatic`
 after upgrading. If they don't do that they will immediately see a helpful
 error message at startup since the manifest won't be found, and they can
 fix the problem then. Still, perhaps that's overly burdensome, I'm not
 sure.

 Another approach would be to have a deprecation cycle where `STATIC_ROOT`
 continues to be checked if the manifest isn't found at the designated
 location in the code base, showing a deprecation warning in that case.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/068.9b040782c89ced1f123edc33d0378929%40djangoproject.com.


Re: [Django] #27590: Allow configuration of where to save staticfiles manifest.

2020-11-20 Thread Django
#27590: Allow configuration of where to save staticfiles manifest.
-+-
 Reporter:  David Sanders|Owner:  Jarosław
 Type:   |  Wygoda
  Cleanup/optimization   |   Status:  assigned
Component:  contrib.staticfiles  |  Version:  1.10
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  1
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Jarosław Wygoda):

 Making the location of `staticfiles.json` configurable allows us to
 maintain a backward compatibility by setting the default manifest path to
 `STATIC_ROOT`. If we don't want to maintain a backward compatibility then
 I can make manifest location not configurable and get rid of
 `ManifestHandler`. Manifest will be created in the `BASE_DIR` instead.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/068.fcee38da99ccaa311e99d217b0ecc5f3%40djangoproject.com.


Re: [Django] #27590: Allow configuration of where to save staticfiles manifest.

2020-11-17 Thread Django
#27590: Allow configuration of where to save staticfiles manifest.
-+-
 Reporter:  David Sanders|Owner:  Jarosław
 Type:   |  Wygoda
  Cleanup/optimization   |   Status:  assigned
Component:  contrib.staticfiles  |  Version:  1.10
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  1
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Kevin Christopher Henry):

 I argued in #28764 and comment:2 that the location of `staticfiles.json`
 shouldn't be configurable at all, that it should just be stored in the
 code base along with other configuration files (including automatically
 generated ones, like migration files). What are the use cases for storing
 this file anywhere else?

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/068.af711427463b69bce87012bf2ac35b04%40djangoproject.com.


Re: [Django] #27590: Allow configuration of where to save staticfiles manifest. (was: Prevent public access of staticfiles manifest)

2020-11-17 Thread Django
#27590: Allow configuration of where to save staticfiles manifest.
-+-
 Reporter:  David Sanders|Owner:  Jarosław
 Type:   |  Wygoda
  Cleanup/optimization   |   Status:  assigned
Component:  contrib.staticfiles  |  Version:  1.10
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  1
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Carlton Gibson):

 * needs_better_patch:  0 => 1
 * needs_docs:  0 => 1


Comment:

 I think we need to look at where we're headed before we simply add a
 setting here. If we consider the upgrade path, what we don't want to do is
 add a new setting and then need to deprecate it as soon as we improve the
 configuration options, with something along the lines of #26029.

 #26029 is needed because you currently need to provide a storage subclass
 in order to provide configuration parameters:

 {{{
 # In settings.py, where `CustomStorage` adjusts configuration in
 `__init__()`.
 STATICFILES_STORAGE = 'my_app.CustomStorage'
 }}}

 The complaint in #26029 is that providing the subclass is cumbersome, and
 we should be able to specify a dictionary like `DATABASES` and so on.
 But we should solve that problem over there.

 The issue here is that `ManifestStaticFilesStorage` has no way of
 specifying where to store the manifest.

 There's a
 [https://code.djangoproject.com/attachment/ticket/27541/manifest_storage.patch
 patch file] for #27541 (which I'm going to close as a duplicate of this
 ticket) which suggests adding an optional `manifest_storage` kwarg to
 `ManifestFilesMixin` — here you'd pass a configured storage to override
 where to store the manifest file:

 {{{
 # Something like...
 class CustomManifestStorage(ManifestStaticFilesStorage):
 def __init__(self, *args, **kwargs):
 manifest_storage = FileSystemStorage(
 location='path/for/manifest'
 )
 super().__init__(*args, manifest_storage=manifest_storage,
 **kwargs)
 }}}

 Using a storage covers the ''separate s3 bucket'' use-case (and similar)
 but also avoids the cumbersome
 [https://github.com/django/django/pull/12187/files#diff-
 f5c7100e3528e9f6edb98cd5a3d33133bdde6286a89fa472f89980fb07364a8eR366
 ManifestHandler wrapper from the initial PR here].

 I think with that, and tests, and documentation of the new parameter, with
 an example of how to configure it, we have a fix here. (That the
 configuration is a little cumbersome would hopefully spur renewed interest
 in pushing forward with #26029.)

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/068.5c8da068de76e6da9d760c5ae22ded53%40djangoproject.com.