Skip to content

Fix django51 #50

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Sep 17, 2024
Merged

Fix django51 #50

merged 4 commits into from
Sep 17, 2024

Conversation

PetrDlouhy
Copy link
Contributor

@PetrDlouhy PetrDlouhy commented Aug 15, 2024

@harryrhodes
Copy link

Hey is there any update on this issue at all? We are looking to implement this package into a project running Django 51 and are facing the same issue as the one linked. Any update would be appreciated, thanks!

@zerolab zerolab requested a review from tm-kn September 3, 2024 11:54
@PetrDlouhy
Copy link
Contributor Author

From my point of view it is finished, I am ready to make more changes if needed.

Copy link
Member

@tm-kn tm-kn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thank you for the contribution.

@tm-kn tm-kn merged commit 8f06748 into torchbox:main Sep 17, 2024
9 checks passed
@jrthorne
Copy link

jrthorne commented Nov 20, 2024

I just installed the below and am getting the below error. I must admit that the messaging here is rather terse. the fix linked above rererences commit
451fcbe
which does not exist on the repo for wagtail storages repository linked in the github issue above:
#50
which says the solution is:
451fcbe
which is an update to a KVPair in a YML file.
=== ERROR

  File "/usr/local/lib/python3.12/site-packages/django/template/backends/django.py", line 151, in get_template_tag_modules
    for name in get_package_libraries(pkg):
  File "/usr/local/lib/python3.12/site-packages/django/template/backends/django.py", line 176, in get_package_libraries
    raise InvalidTemplateLibrary(
django.template.library.InvalidTemplateLibrary: Invalid template library specified. ImportError raised when trying to load 'sass_processor.templatetags.sass_tags': cannot import name 'get_storage_class' from 'django.core.files.storage' (/usr/local/lib/python3.12/site-packages/django/core/files/storage/__init__.py

==== BELOW requirements.txt

requests
Django==5.1
django-grappelli==3.0.3
django-session-security
wagtail==6.3
Pillow==9.2.0
mysqlclient==2.1.1
sentry-sdk==1.13.0
django-extensions==3.2.1
django-environ==0.9.0
django-dirtyfields==1.8.2
django-global-permissions==0.2.6
django-mathfilters==1.0.0
django-crispy-forms==1.14.0
django-select2==7.10.1
django-compressor==4.5.1
django-htmlmin==0.11.0
django-sass-processor==1.2.1
libsass==0.21.0
beautifulsoup4==4.11.1
django-bootstrap-datepicker-plus
ua-parser==0.16.1
django-user-agents==0.4.0
user-agents==2.2.0
djangorestframework

@PetrDlouhy
Copy link
Contributor Author

@jrthorne There is no import of get_storage_class in wagtail_storages code after merging #50, which is included in version 2.0.
You must have old version, or the error must come from different package.

BTW Please use <> code button to format your error messages and console outputs to make them readable.

@zerolab
Copy link
Member

zerolab commented Nov 20, 2024

Looking at the requirements.txt listed above, there is no wagtail-storages. And the error points to django-sass-processor

@tm-kn
Copy link
Member

tm-kn commented Nov 20, 2024

@jrthorne Looks like you might be on an old version of the django sass processor that does not support your Django version. Quick search throws this up: https://github.com/search?q=repo%3Ajrief%2Fdjango-sass-processor%20get_storage_class&type=code I think this is unrelated.

@jrthorne
Copy link

Thank you so much @tm-kn The solution was and upgrade to
django-sass-processor==1.4.1
libsass==0.23.0
Not specifying the version number did not upgrade the packages. I had to specifically reference the latest versions.

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.

Django 5.1: ImportError: cannot import name 'get_storage_class' from 'django.core.files.storage'
5 participants