Closed bpepple closed 4 years ago
This sounds like it's related to the open PR #36
Didn't see the PR, but it looks like it's the same thing. Not quite sure why the PR is using '_from django.contrib.staticfiles.storage import staticfilesstorage' instead of what's in the release notes, but haven't looked into this other than at a cursory level, so maybe there's a good reason.
Looks like it's effectively the same thing. If this is the correct documentation for django.templatetags.static.static()
then it uses django.contrib.staticfiles.storage.staticfiles_storage.url()
anyway:
If the
django.contrib.staticfiles
app is installed, the tag will serve files usingurl()
method of the storage specified bySTATICFILES_STORAGE
.
Regarding STATICFILES_STORAGE
:
A ready-to-use instance of the storage backend defined in this setting can be found at
django.contrib.staticfiles.storage.staticfiles_storage
django.templatetags.static.static()
is just more convenient since url()
doesn't need to be explicitly called.
If that's the case, something like this should fix it:
from django import version as VERSION
if VERSION < 3:
from django.contrib.staticfiles.templatetags.staticfiles import static
else:
from django.templatetags.static import static
I don't think a version check is necessary since it's been around since Django 1.10.
Hey guys, I'm using django > 3 and I'd really like it if I could still use your awesome package can you please merge my pull request [https://github.com/python-discord/django-simple-bulma/pull/38] or solve this minor import issue?
Addressed in #38
@bpepple @talperetz
We've released version 1.2.0 now on PyPI, which supports Django 3.x
Looks like a least one change is needed to be make to django-simple-bulma work with for Django 3.*
django_simple_bulma.py uses 'from django.contrib.staticfiles.templatetags.staticfiles import static' in it's imports and it looks like it was depreciated in Django-2.1* for 'django.templatetags.static.static()'
https://docs.djangoproject.com/en/3.0/releases/2.1/#deprecated-features-2-1
If I get a few free cycles I'll look at working up a fix, and see if there are any other changes that need to be made.