alex / django-templatetag-sugar

This project exists to make defining template tags in Django kickass
BSD 3-Clause "New" or "Revised" License
211 stars 38 forks source link

updated for django 1.9 #13

Closed loimu closed 8 years ago

loimu commented 8 years ago

django.db.models.loading module was removed since 1.9 https://docs.djangoproject.com/en/1.9/internals/deprecation/

alex commented 8 years ago

Can you do a try / except here so that we continue to support old versions of Django?

chathaway-codes commented 8 years ago

Hi there! Will this get merged anytime soon? It addresses a problem I'm encountering.

pelme commented 8 years ago

The try/except should probably be the other way around - first try with the new API and fall back to the old django.db.models.loading, i.e..

try:
    from django.apps import apps as cache
except ImportError:
    from django.db.models.loading import cache
pelme commented 8 years ago

Why is this PR closed? The proposed change is not yet merged.

loimu commented 8 years ago

@pelme Because it's better to create a new one. Too many changesets for such a minor change. The actual code:

try:
    from django.apps import apps as cache # django >= 1.7
except ImportError:
    from django.db.models.loading import cache # django < 1.7
nicksergeant commented 8 years ago

This lib seems broken due to this change not being merged.

Gim6626 commented 5 years ago

Lib is really broken, as @nicksergeant said. I get ModuleNotFoundError: No module named 'django.db.models.loading' error on from django.db.models.loading import cache