50👍
Even though this question is a few years old, people recently may be seeing this error again, but for a different reason. Here’s the error again:
AttributeError: 'Library' object has no attribute 'assignment_tag'
You may be seeing this error after upgrading to Django 2.0. This is because assignment_tag
was deprecated in Django 1.9, and removed in Django 2.0:
Django 1.4 added the
assignment_tag
helper to ease the creation of template tags that store results in a template variable. Thesimple_tag()
helper has gained this same ability, making theassignment_tag
obsolete. Tags that useassignment_tag
should be updated to usesimple_tag
.
Note that the behaviour of simple_tag
is similar but not identical to assignment_tag
in Django 1.8.
3👍
Just got this same error with package social_widgets, Python 3.7 and Django 2.2. Changing assignment_tag to simple_tag in social_widgets.py solved the problem for me.
- Sending a message to a single user using django-channels
- Celery – No module named five
- How do I simulate connection errors and request timeouts in python unit tests
0👍
Just ran into this during an upgrade to Django 2. The problem showed up in django-debug-toolbar
but was actually corrected by updating django-webpack-loader
to the latest version.
- TypeError: create_superuser() missing 1 required positional argument: 'profile_picture'
- ProgrammingError: relation "django_session" does not exist
- How does django-nose differ from the default Django test-runner