[Django] #34929: Issue with Django 3.2 and Django-storage 1.14.2 after Upgrading from Django 2.2.28

12 views
Skip to first unread message

Django

unread,
Oct 26, 2023, 12:16:48 PM10/26/23
to django-...@googlegroups.com
#34929: Issue with Django 3.2 and Django-storage 1.14.2 after Upgrading from Django
2.2.28
-------------------------------------+-------------------------------------
Reporter: akash- | Owner: nobody
vantage |
Type: Bug | Status: new
Component: Utilities | Version: 3.2
Severity: Normal | Keywords: static files,
Triage Stage: | ManifestStaticFilesStorage
Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
- Upgraded from Django 2.2.28 to 3.2.
- Using Django-storage 1.14.2.
- Replaced CachedFilesMixin with ManifestStaticFilesStorage.
- Post-upgrade, everything was the same; no other settings changed.
- Issue: self.location is caching a None value that doesn't alter.
- Temporary Fix: Deleting the cache in the debugger manually with a del
statement resolves the issue.
Code Snippet:
{{{#!python
class StaticFilesStorage(ManifestStaticFilesStorage, S3Boto3Storage):
def __init__(self, *args, **kwargs):
S3Boto3Storage.__init__(self,
bucket_name=settings.STATIC_FILES_BUCKET,
custom_domain=domain(settings.STATIC_URL), *args, **kwargs)
ManifestStaticFilesStorage.__init__(self, *args, **kwargs)

}}}
}}}
PDB output showing cached None value in self.location:
{{{
(Pdb) self.base_location
'tmp/vantage/static/'
(Pdb) self.location
''
(Pdb) os.path.abspath(self.base_location)
'/app/tmp/vantage/static'
(Pdb) del self.location
(Pdb) self.location
'/app/tmp/vantage/static'
(Pdb) self._location
'tmp/vantage/static/'
(Pdb) c
}}}

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

Django

unread,
Oct 26, 2023, 12:19:14 PM10/26/23
to django-...@googlegroups.com
#34929: Issue with Django 3.2 and Django-storage 1.14.2 after Upgrading from Django
2.2.28
-------------------------------------+-------------------------------------
Reporter: Akash Ilangovan | Owner: nobody

Type: Bug | Status: new
Component: Utilities | Version: 3.2
Severity: Normal | Resolution:

Keywords: static files, | Triage Stage:
ManifestStaticFilesStorage | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Description changed by Akash Ilangovan:

Old description:

New description:

- Upgraded from Django 2.2.28 to 3.2.
- Using Django-storage 1.14.2.
- Replaced CachedFilesMixin with ManifestStaticFilesStorage.
- Post-upgrade, everything was the same; no other settings changed.
- Issue: self.location is caching a None value that doesn't alter.
- Temporary Fix: Deleting the cache in the debugger manually with a del
statement resolves the issue.
Code Snippet:
{{{#!python
class StaticFilesStorage(ManifestStaticFilesStorage, S3Boto3Storage):
def __init__(self, *args, **kwargs):
S3Boto3Storage.__init__(self,
bucket_name=settings.STATIC_FILES_BUCKET,
custom_domain=domain(settings.STATIC_URL), *args, **kwargs)
ManifestStaticFilesStorage.__init__(self, *args, **kwargs)

}}}
Error output:
{{{
File /usr/local/lib/python3.8/dist-
packages/django/contrib/staticfiles/storage.py:38, in
StaticFilesStorage.path(self, name)
36 def path(self, name):
37 if not self.location:
---> 38 raise ImproperlyConfigured("You're using the staticfiles
app "
39 "without having set the
STATIC_ROOT "
40 "setting to a filesystem
path.")
41 return super().path(name)

ImproperlyConfigured: You're using the staticfiles app without having set
the STATIC_ROOT setting to a filesystem path.


}}}
PDB output showing cached None value in self.location:
{{{
(Pdb) self.base_location
'tmp/vantage/static/'
(Pdb) self.location
''
(Pdb) os.path.abspath(self.base_location)
'/app/tmp/vantage/static'
(Pdb) del self.location
(Pdb) self.location
'/app/tmp/vantage/static'
(Pdb) self._location
'tmp/vantage/static/'
(Pdb) c
}}}

--

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

Django

unread,
Oct 26, 2023, 12:21:06 PM10/26/23
to django-...@googlegroups.com

Old description:

New description:

The error is resolved after manually refreshing the cache on self.location

--

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

Django

unread,
Oct 26, 2023, 1:08:56 PM10/26/23
to django-...@googlegroups.com
#34929: Issue with Django 3.2 and Django-storage 1.14.2 after Upgrading from Django
2.2.28
-------------------------------------+-------------------------------------
Reporter: Akash Ilangovan | Owner: nobody
Type: Bug | Status: closed
Component: Utilities | Version: 3.2
Severity: Normal | Resolution: invalid

Keywords: static files, | Triage Stage:
ManifestStaticFilesStorage | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Natalia Bidart):

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


Comment:

Hello, thank you for your report!

I'll be closing this issue as invalid following the
[https://docs.djangoproject.com/en/4.2/internals/contributing/triaging-
tickets/#closing-tickets triaging docs], because:

1. On one hand, Django 2.2.x has been deprecated for more than a year and
a half, and Django 3.2 is on security-only update mode.
2. On the other hand, given your custom implementation of
`StaticFilesStorage`, is unclear how Django (itself) is at fault here.
Have you tried seeking help in the Django user forum, or in the django-
storages support channels?

The best place to get answers to your issue is using any of the user
support channels from [https://docs.djangoproject.com/en/dev/faq/help
/#how-do-i-do-x-why-doesn-t-y-work-where-can-i-go-to-get-help this link].

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

Reply all
Reply to author
Forward
0 new messages