lemonsaurus / django-simple-bulma

Django application to add the Bulma CSS framework and its extensions
MIT License
137 stars 17 forks source link

Upgrade to Django 3.* #37

Closed bpepple closed 4 years ago

bpepple commented 4 years ago

Looks like a least one change is needed to be make to django-simple-bulma work with for Django 3.*

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.

MarkKoz commented 4 years ago

This sounds like it's related to the open PR #36

bpepple commented 4 years ago

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.

MarkKoz commented 4 years ago

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 using url() method of the storage specified by STATICFILES_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.

bpepple commented 4 years ago

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
MarkKoz commented 4 years ago

I don't think a version check is necessary since it's been around since Django 1.10.

talperetz commented 4 years ago

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?

lemonsaurus commented 4 years ago

Addressed in #38

lemonsaurus commented 4 years ago

@bpepple @talperetz

We've released version 1.2.0 now on PyPI, which supports Django 3.x