django-activity-stream: Django 1.11 Incompatibilities

The overall functionality to store actions via signals seems to work nicely in Django 1.11, but trying to use the activity_stream and display_action templatetags I came across some small things that are broken due to changes in 1.11.

  • actstream/templatetags/activity_tags.py, line 96:

    return render_to_string(templates, context)
    

    Context is a django.template.context.Context instance here, but in 1.11 it must be a simple dict,

    return render_to_string(templates, context.flatten())
    

    would possibly fix that, haven’t fully tested it yet.

  • actstream/urls.py, top of the file:

    try:
        from django.conf.urls import url, patterns
    except ImportError:
        from django.conf.urls.defaults import url, patterns
    

    The patterns() function is not available anymore, either the url patterns need some rework or you’d have to provide your own vendorized version. In 1.9 it says:

    django.conf.urls.patterns() is deprecated and will be removed in Django 1.10. Update your urlpatterns to be a list of django.conf.urls.url() instances instead.

  • actstream/views.py: All usage of render_to_response() is a problem, see https://docs.djangoproject.com/en/1.11/releases/1.10/

    The dictionary and context_instance parameters for the following functions are removed: django.shortcuts.render() django.shortcuts.render_to_response()

The changelog tells me that the latest, officially supported Django version is 1.9. Are there any plans yet to extend support to Django 1.10+?

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 3
  • Comments: 31 (3 by maintainers)

Most upvoted comments

Thanks for your work @cmwaura 🙇

whats the status of this PR? Eagerly waiting for 1.11 support

@cmwaura , Thank you for the effort! I just got it working (installed it from the repo), after a few minor tweaks.

Hope @justquick or @auvipy can bump the version number and have this officially on PIP.

@cmwaura I have been waiting Django 1.11 support for long, after your confirmation I have just tried to test with latest version.

This is what I got:

  File "<frozen importlib._bootstrap>", line 978, in _gcd_import
  File "<frozen importlib._bootstrap>", line 961, in _find_and_load
  File "<frozen importlib._bootstrap>", line 950, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 655, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 205, in _call_with_frames_removed
  File "/Users/sardor/Projects/incogwas/igsite/incogwas/urls/__init__.py", line 14, in <module>
    url(r'activity/', include('actstream.urls')),
  File "/Users/sardor/.virtualenvs/incogwas/lib/python3.6/site-packages/django/conf/urls/__init__.py", line 50, in include
    urlconf_module = import_module(urlconf_module)
  File "/Users/sardor/.virtualenvs/incogwas/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 978, in _gcd_import
  File "<frozen importlib._bootstrap>", line 961, in _find_and_load
  File "<frozen importlib._bootstrap>", line 950, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 655, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 205, in _call_with_frames_removed
  File "/Users/sardor/.virtualenvs/incogwas/lib/python3.6/site-packages/actstream/urls.py", line 5, in <module>
    from django.conf.urls.defaults import url, patterns
ModuleNotFoundError: No module named 'django.conf.urls.defaults'

System information:

$ python --version
Python 3.6.0
$ python -c 'import django; print(django.__version__)'
1.11
$ python -c 'import actstream; print(actstream.__version__)'
0.6.3

@subho007 @auvipy it seems like the codebase was fixed but the fixes live within github… am looking at the latest code and it looks fixed. Am I missing something?

@subho007 working on it right now… Sorry work got me really busy.

you can ryn the tests against 1.11.1 and fix them one by one my prvious work was staled due to my laptops demage. https://github.com/justquick/django-activity-stream/pull/334 i could resume the work next week if no one beat me